HOLE DETECTION IN PLASTIC MULCH USING TEMPLATE MATCHING AND MACHINE LEARNING ALGORITHMS

Mulch is a ground cover material to maintain soil moisture and temperature stability as a plant medium. Mulch also helps prevent weed growth for better plant growth. For planting with plastic mulch, farmers need to make holes in the mulch the day before planting. Precision agriculture is needed because it can obtain savings in input financing, labor, and better yields, so this research aims to identify holes in mulch based on Unmanned Aerial Vehicle images. The advantage of this research is that it can monitor each plant based on the mulch holes, and the number of holes identified can be used as a parameter to estimate the amount of crop production. This research combines Template Matching Algorithm and Machine Learning Algorithm to improve accuracy in predicting holes in mulch. Three machine learning algorithms are used, namely the Random Forest, Support Vector Machine, and XGBoost. The data used is an orthophoto mosaic from aerial photographs. Nine areas were taken from orthophotos to be used as research samples. The results of this study obtained the highest average recall, precision, and f-measure values using the Support Vector Machine algorithm with a recall value of 87.7%, precision of 97.5%, and f-score of 92.3%. This research focuses on reducing detected commission errors. Therefore, omission errors were still detected in the damaged or leaf-covered holes.


INTRODUCTION
As a planting medium, mulch is a ground cover material to maintain soil moisture and temperature. Mulch also has the function of preventing weed growth for better plant growth. Placing mulch on the beds during the rainy season can prevent erosion on the surface of the beds, especially for horticultural commodities. Mulch can prevent splashes of rainwater that can stick to the fruit skin, causing infection at the splash points. Meanwhile, mulching during the dry season can retain direct sunlight so that the soil's surface is warm and moist.
This prevents evaporation, so groundwater is used more efficiently [1].
Mulch is generally divided into three types: inorganic, organic, and synthetic.
Inorganic mulch layers include gravel, coral, coarse sand, and other rocks. Organic mulch is available in plant residues such as straw, corn stalks, bean stalks, cement paper, etc. Meanwhile, synthetic mulch is a factoryproduced humus, such as silver-black plastic [1]. However, black plastic mulch is more profitable than rice straw and husk [2].
To plant using plastic mulch, farmers need to make holes in the mulch shown in Figure 1 (b) a day before planting, with the distance between the holes depending on the type of plant. Usually, the holes in the mulch are sown with plant seeds, so the number of holes in the mulch can be the number of plants present.
(a) (b) (c) Figure 1. Examples of (a) installing plastic mulch, (b) making holes in mulch, (c) planting using mulch (source: google.com) Besides that, precision agriculture is currently needed because it can obtain financial savings, labor, and better crop yields [3]. Precision agriculture is a farm management concept based on observing, measuring, and responding to crop variability within and outside the industry [4].
Therefore, this is the background for researchers in conducting research based on precision agriculture, namely being able to identify holes in mulch. The benefits of this research are observing each plant based on the mulch holes. The number of holes obtained from the identification results, this number can be measured to estimate the amount of crop production.
Identifying holes in the mulch using a Template Matching algorithm based on Unmanned Aerial Vehicle (UAV) imagery. The Template Matching Algorithm is an area approach suitable for templates with weak image features or similar patterns [5]. Compared to other methods, the Template Matching algorithm's advantages are that it is simple, widely used for pattern recognition [6], and very easy to implement [7], so it is very suitable to be applied in this research.
Researchers have yet to find research that discusses the detection of holes in mulch, either with the Template Matching algorithm or other algorithms. However, researchers found several studies with the same pattern, namely research on detecting plants and trees. Several studies have been conducted to detect plants using a Template Matching algorithm based on aerial photography. Hanapi et al [8] conducted a study to detect and calculate oil palm trees from remote sensing data with an accuracy of 89%. Hashim et al [9] conducted a study to analyze oil palm trees using drone-based remote sensing imagery with an accuracy of 73%. Aeberli et al [10] conducted a study on banana trees to determine the suitability of multispectral UAV image data at several collection dates with an accuracy of 86%. Tao et al [11] conducted a study on the spatial distribution of dead pine trees in mountainous areas for cleaning diseased wood and predicting pine wilt with a maximum accuracy of 65%. Liu et al [12] conducted a study with a modification of the Faster Region-based Convolutional Neural Network (FRCNN) algorithm for palm tree detection to reduce overfitting problems and increase detection accuracy resulting in an accuracy of 76%. Irsanti et al [13] conducted a study to analyze the results of manual and automatic identification and counting of oil palm trees, resulting in a maximum accuracy of 94%.
From these studies, it can be concluded that plant detection was carried out on canopied trees. This is what distinguishes between previous research and research conducted in this paper. Because in this paper, the objects detected are holes in the mulch, but with the same goal, namely to be able to monitor plants.
The purpose of this research is to continue and improve the quality produced in the research that has been done before and has been presented by researchers at the International Seminar on Aerospace Science and Technology (ISAT) 2022 with the title of the paper, namely Identification of Holes in Plastic Mulch Based on UAV Multispectral Image Using Template Matching The algorithm was carried out on November 23, 2022. The level of accuracy produced in previous research was an average of 86%.
To improve the accuracy produced in previous studies, researchers added a machine learning algorithm to classify mulch and nonmulch land. This aims to eliminate commission errors resulting from detection errors in nonmulched areas. Three machine learning algorithms are used to compare and determine the best algorithm to improve accuracy in this study: Random Forest, Support Vector Machine, and XGBoost. The advantage of the Random Forest algorithm is that it is very effective in dealing with overfitting because trees or classifieds are generated randomly [14]. The advantage of the Support Vector Machine algorithm is in generalization by minimizing the occurrence of prediction errors and parameter estimation to find the best hyperplane for different classes [15]. The XGBoost algorithm's advantages are speed, scalability, efficiency, and simplicity [16].

METHOD Time and Place of Research
This research was conducted in March 2022 and July 2022. The research site was in a 215-hectare food estate in Pollung District, Humbang Hasundutan Regency, North Sumatra Province. This regency is located at coordinates 2º 15' 55.84'' N, 98º 30' 13.54'' E.

Data Acquisition
This study uses orthophoto mosaic data from aerial photo processing using UAV. The type of UAV used is DJI P4 Multispectral, with the camera specifications shown in Table 1. The following is the orthophoto mosaic data from the aerial photo processing used:

Figure 2. Orthophoto Results
The following is information from the results of the mosaic orthophoto:  Coordinate system: EPSG:4326 -WGS 84  Scale unit: degrees  Scale: 1:321  Dimensions: 7958 x 6396  Average flying height: 10 meters

Cropping Area
The cropping process is needed to take samples of locations that are used as comparisons. Try to choose parts of the area that have different situations. For example, in one cut area, clouds shade some parts, different soil colors, exposure to sunlight with different intensities, and the number of holes in the mulch. The difference in these situations is a parameter that is used as a benchmark for the accuracy of calculating the number of holes in the mulch automatically.

Digitizing
At this stage, the photo resulting from the cropping area is digitized. The researchers marked each hole with a dot or pointed to facilitate identification. After marking each hole with points is complete, save the editing results, then display the attribute table on the manual calculation layer. The number of points can be immediately known. This calculation process uses the editing tools available in the QGIS application.

Hole Detection with Template Matching
At this stage, the detection and calculation of holes in the mulch are carried out automatically in the cropped area photos using the Template Matching algorithm. Template matching is a digital image processing technique for finding small parts of an image that match an image pattern. The general classification of the template matching approach is almost the same as that of image matching. Image matching has three approaches: based on areas, features, and relationships. The areabased approach is sometimes called the template matching method [5]. This approach is especially suitable for templates with weak features with images such as holes in mulch. The Template Matching process can be described as follows [5]:  Select Sample. Taking or selecting samples in the process of making templates that aim so that applications can make introductions to the shape of objects to detect the object under study. Sampling is done based on each area with a value of 20 for size and 4 for context.  Test Template. This stage uses the threshold method. The threshold is the same in each area, with a value of 0.75.  Classification results.

Land Classification with Machine Learning
At this stage, the classification of mulch and non-mulch areas is carried out on the cropped area photos using the Machine Learning algorithm. Three algorithms are used to classify land: Random Forest, Support Vector Machine, and XGBoost. Random Forest is a classification algorithm that uses a decision tree as a basis for classifiers by expanding many classification trees to liken the tree to a forest. The forest selects the taxonomy with the most ranking of all trees. This algorithm is practical when you have a large data set and can handle many variables without removing variables, such as classifying land from an image [17]. Support Vector Machine is a supervised learning classification method that uses nonlinear mapping to convert the original training data to a higher dimension [18]. Xgboost is a machine learning algorithm that can be used for predictions or rankings based on decision trees [19]. XGBoost can solve regression and classification problems based on Gradient Boosting Decision Trees (GBDT) [20].

Overlay Area
At this stage, an overlay of the mulch hole classification area is performed with the Template Matching algorithm and the mulch classification area with the Machine Learning algorithm, which aims to eliminate detected points outside the mulch area. The overlay is an overlapping process that combines two or more layers/thematic inputs and produces a new thematic from the process. In short, overlay one digital map on top of another and its attributes and generate a composite map of the two that contains information about the attributes of both maps. The overlay merges data from different layers [21]. The facilities used at this stage are intersected. Intersect is an operation that cuts a theme or input layer with the theme's attributes to produce output with attributes with attribute data from both themes [21].

Evaluation of predicted results
At this stage, a comparison of the results of calculating the number of holes using the digitization method and the automatic method is carried out, both before and after the overlay, to determine the resulting accuracy results. It was found that the area's situation on the aerial photo of the food estate land, as previously mentioned, has a major influence on the success of the calculation. In addition, the quality of aerial photography as a basic input is also a benchmark. Commission error is calculated when the point of detection results identify objects outside other than holes in the mulch. Omission error is calculated when no points are detected within the known mulch boundaries [22]. Based on Yun et al [23], the detection results were evaluated using precision, recall, and f-score, as shown in equations (1) to (3):

RESULT AND DISCUSSION Cropping Area
The corrected orthophotos were then cut into the smaller areas shown in Figure 3 to count the number of holes in the mulch. For the cutting area, nine areas were selected, which had different situations compared with the accuracy results. Taking or selecting samples in the process of making templates aims that the application can make the introduction to introduce the shape of the object. To detect The object under study is shown in Figure 4. Sampling is carried out based on each area with a size value of 20 and a context value of 4. In area 1, 6 samples are taken, which are generated into 80 samples. Area 2 is taken as a sample of 6 samples generated into 64 samples. Area 3 is taken as a sample of 6 samples generated into 44 samples. Area 4 is taken as a sample of 10 samples generated into 165 samples. Area 5 is taken as a sample of 10 samples generated into 108 samples. Area 6 is taken as a sample of 10 samples generated into 252 samples. Area 7 is taken as a sample of 10 samples generated into 127 samples. Area 8 is taken as a sample of 10 samples generated into 167 samples. Area 9 is taken as a sample of 10 samples generated into 227 samples. The layer used is layer 3 (blue band).

Test Sample
This stage uses a threshold of the same value in each area with a value of 0.75 with the number of holes detected in area 1 as many as 295 holes, in area 2 as many as 171 holes, in area 3 as many as 178 holes, in area 4 as many as 801 holes, in area 5 there are 1,134 holes, in area 6 there are 1,291 holes, in area 7 there are 1,471 holes, in area 8 there are 2,407 holes, and in area 9 there are 2,359 holes. Figure 5 is the holes detected in the mulch area 1. Based on Figure 5, the information found is: •

Analysis of Hole Calculation Results After Overlaying
In Figure 5 (a) shows many commission errors, especially in rocky areas. This is because almost the entire plot has a rocky background with many patterns resembling holes in the mulch. Whereas in Figures 5 (b) and 5 (d), the commission error has decreased a lot, but some points are still detected. However, in Figure 5 (c), no dots were detected outside the mulch.

•
Omission errors in area 1, both in Figure  5 (a) - Figure 5 (d), are detected in several parts, namely in holes covered by leaves, in holes that do not form a perfect circle, and on the edges where the holes are cut off by boundaries plot.
(a) (b) (c) (d) Figure 5. Results of hole detection in mulch in area 1 before overlay using (a) Template Matching and after overlay using (b) Random Forest, (c) Support Vector Machine, and (d) XGBoost Figure 6 is the holes detected in the mulch area 2. Based on Figure 6, the information found is: • In Figure 6 (a) shows many commission errors, especially in rocky areas. This is because almost the entire plot has a rocky background with many patterns resembling holes in the mulch. Whereas in Figure 6 Figure 9 is the holes detected in the mulch area 5. Based on Figure 9, the information found is: • In Figure 9 (a) - Figure 9 (d), commission errors remain, especially in rocky areas.
There are still plots with a background of rocky areas that have a pattern resembling holes in the mulch.
• Omission errors in this area 5, both in Figure 9 (a) - Figure 9 (d), are detected in several parts, namely in holes covered by leaves, in holes that do not form a perfect circle, and on the edges where the holes are cut off by boundaries plot. Figure 9. Results of hole detection in mulch in area 5 before overlay using (a) Template Matching and after overlay using (b) Random Forest, (c) Support Vector Machine, and (d) XGBoost Figure 10 is the holes detected in the mulch area 6. Based on Figure 10, the information found is: • In Figure 10 (a), Figure 10 (b), and Figure  10 (d), there are still many commission errors, especially in rocky areas. This is because there are quite some plots with a background of rocky areas that have a pattern resembling holes in the mulch. Figure 10 (c), the commission error has decreased a lot, several points are still detected.

•
Omission errors in area 6, both in Figures  10 (a) -10 (b), are detected in several parts, namely in holes covered by leaves, in holes that do not form a perfect circle, and on the edges where plot boundaries cut the holes.
(a) (b) (c) (d) Figure 10. Results of hole detection in mulch in area 6 before overlay using (a) Template Matching and after overlay using (b) Random Forest, (c) Support Vector Machine, and (d) XGBoost Figure 11 is the holes detected in the mulch area 7. Based on Figure 11, the information found is: • In Figure 11 (a) shows commission errors, especially in the land area. This is because there are still plots with rocky areas in the background that have a pattern resembling holes in the mulch. Whereas in Figure 11 (b) - Figure 11 (d), the commission error has decreased quite a lot, but several points are still detected.

•
Omission errors in area 7, both in Figures  11 (a) -11 (d), are detected in several parts, namely in holes covered by leaves, in holes that do not form a perfect circle, and on the edges where plot boundaries cut the holes off. Figure 12 shows the holes detected in area 8 mulch. Based on Figure 12, the information found is: • In Figure 12 (a), there are still commission errors, especially in the land area. This is because there are still plots with rocky areas in the background that have a pattern resembling holes in the mulch. Whereas in Figure 12 (b) - Figure  12 (d), the commission error has decreased quite a lot, but several points are still detected.  Figure 13. The results of hole detection in mulch in area 9 before overlay using (a) Template Matching and after overlay using (b) Random Forest, (c) Support Vector Machine, and (d) XGBoost Figure 13 is the holes detected in the mulch area 9. Based on Figure 13, the information found is: • In Figure 13 (a) shows commission errors, especially in the land area. This is because there are still plots with rocky areas in the background that have a pattern resembling holes in the mulch. Whereas in Figure 13 (b) - Figure 13 (d), the commission error has decreased quite a lot, but several points are still detected.  Table 2 details the number of detections, errors, and accuracy in the nine study areas processed using the Template Matching and Machine Learning algorithms. As can be seen in Figure 14, the f-score value before overlay shows that the detection using only the Template Matching algorithm achieves an f-score of 88.2%. Overall accuracy after overlay shows that the Random Forest classification achieves a f-score value of 91.7%, the Support Vector Machine classification achieves a f-score value of 92.3%, and the XGBoost classification achieves a f-score value of 92.0%. The Support Vector Machine classification achieved the highest a f-score, which reached 92.3%. The results of this accuracy can be said to be very good because the accuracy value is generally said to be very good if it is above the value of 90% [24].   that there is no increase in accuracy after overlaying, this shows that the omission error is not reduced because the overlay process only eliminates commission errors. Figure 15. Chart of recall results from nine sample areas Figure 16 shows the precision values for the nine study areas that have been detected using template matching algorithms and machine learning algorithms. It can be seen that Area 1 and Area 2 have a low level of accuracy before overlaying, this is because, in Area 1 and Area 2, many background rocks are considered or detected as mulch holes or are called commission errors. After this overlay is done, the resulting accuracy is greatly improved because many commission errors are reduced.

CONCLUSION
This research study shows that the Template Matching algorithm can detect holes in the mulch. To find the best image, aerial photography is taken with an average flying height of ten meters. The combination of the Template Matching algorithm and the Machine Learning algorithm can increase the level of accuracy compared to using only the Template Matching algorithm with an average f-score of 88.2%. The highest average f-score after merging or overlaying is achieved by the SVM algorithm of 92.3%. However, the resulting accuracy uses default parameters in building machine learning models. From the results of the analysis that has been carried out, the commission errors detected in areas other than mulch, especially in areas with rocky backgrounds, have been greatly reduced compared to before the overlay process was carried out. However, the commission errors detected in the mulch plastic did not decrease.

Precision value chart
To be able to reduce omission errors, researchers suggest trying to use other deep learning algorithms to detect holes in this mulch. To be able to reduce commission errors, researchers suggest trying to use another machine learning algorithm to classify mulch areas and not mulch. To be able to improve accuracy in machine learning classification, researchers suggest trying to use hyperparameter tuning to find the optimal value of the hyperparameter that can improve the performance of the machine learning model.