Implementation of Grading Method for Gambier Leaves Based on Combination of Area, Perimeter, and Image Intensity Using Backpropagation Artiﬁcial Neural Network

: Gambier leaves are widely used in cosmetics, beverages, and medicine. Tarantang village in West Sumatera, Indonesia, is famous for its gambier commodity. Farmers usually classify gambier leaves by area and color. They inherit this ability through generations. This research creates a tool to imitate the skill of the farmers to classify gambier leaves. The tool is a box covered from outside light. Two LEDs are attached inside the box to get maintain light intensity. A camera is used to capture the leaf image and a raspberry Pi processes the leaf features. A mini monitor is provided to operate the system. Six hundred and twenty-ﬁve gambier leaves were classiﬁed into ﬁve grades. Leaves categorized into grades 1, 2, and 3 are forbidden to be picked. Grade 4 leaves are allowed to be picked and those in grade 5 are the recommended ones for picking. Leaf features are area, perimeter, and intensity of leaf image. Three artiﬁcial neural networks are developed based on each feature. One thousand leaf images were used for training and 500 leaf images were used for testing. The accuracies of the features are about 93%, 96% and 97% for area, perimeter and intensity, respectively. A combination of rules are introduced into the system based on the feature accuracy. Those rules can give 100% accuracy compared to the farmer’s recommendation. A real time application to classify the leaves could provide classiﬁcation with the same decision result as the classifying performed by the farmers.


Introduction
Gambier is a commodity plant with a good economic value. Gambier is used for several purposes such as medicine, food, and paint. Indonesia has been one of the main gambier producers in the world [1]. The Indonesian gambier production total in 2013 was 20,507 tons and West Sumatera dominated with a 13,809-ton gambier production, or 67% of the total Indonesian production [2]. Lima Puluh Kota, a region in West Sumatera, is the center of gambier cultivation. It supplies almost 70% of gambier from West Sumatera [3]. Gambier can be used in various industries such as cosmetics, 1. Farmers in Tarantang Village have been manually picking gambier leaves to be processed. They have learned this skill from their senior farmers by directly testing the gambier trees. The learning process requires considerable time and is highly dependent on the availability of experienced farmers. Over the years, this routine has become more challenging and complicated because the number of young people wanting to get involved in farming, especially the gambier plant, is significantly decreasing. In this study, we introduce the first modelling of the farmers' knowledge for classifying gambier leaf in Tarantang Village. There is a probability that the gambier leaf from other areas are different from Tarantang Village, which required further research. 2. This research implemented the farmers' knowledge about the gambier leaf to a real time system. A leaf can be set up inside a designed box to be analyzed in real time in order to determine whether a leaf is ready to be picked or not. 3.
The three features in this research are area, perimeter, and intensity. These features require farmers' knowledge, who classify gambier leaf based on size and color. Three artificial neural networks were designed based on each feature. Each feature has advantages in classifying; however, the highest accuracy is only about 97%.

4.
A combination of three artificial neural networks for three features was designed as the final rule of the real time system to classify gambier leaf. The result shows that the combination resulted in a high accuracy of 100% in which the same decision was reached between farmers and the system when 500 leaves were classified.

Sample of Leaf
This study was conducted on gambier leaves from Tarantang Village, West Sumatera, Indonesia. This village is very famous for its gambier production. From discussions with the farmers, the gambier leaves in Tarantang Village are usually picked when they have reached the age of 5 months. The farmers usually use area and color of the leaf to simplify the selection process. Table 1 shows the explanation of color and area of the five grades and their class. Leaves that are old enough are classified as grade 5. This is the only recommended grade to be picked by farmers, yet a few grade 4 leaves are also carried away in the picking process. Grade 1, 2, and 3 leaves are totally forbidden to be picked, because they could degrade product quality.

System Design
A group of farmers with approximately 30 years of experience with gambier plant was asked to classify the leaves into grades 1, 2, 3, 4, and 5. This grade was also related to the age of leaf. The age prediction made by the farmers for grades 1 to 5 were 1 month, 2 months, 3 months, 4 months, and 5 months, respectively. There were 300 leaves in each grade.
A system was designed to predict leaf maturity. The system designed to classify the leaves has four main parts, as shown in Figure 1. The input is the gambier leaf image captured by a camera. The output is leaf grade shown on an LCD. A raspberry Pi as a microprocessor is used to process image features and recognize the grade. A user interface was designed to operate this system on a mini monitor. 2. This research implemented the farmers' knowledge about the gambier leaf to a real time system. A leaf can be set up inside a designed box to be analyzed in real time in order to determine whether a leaf is ready to be picked or not. 3. The three features in this research are area, perimeter, and intensity. These features require farmers' knowledge, who classify gambier leaf based on size and color. Three artificial neural networks were designed based on each feature. Each feature has advantages in classifying; however, the highest accuracy is only about 97%. 4. A combination of three artificial neural networks for three features was designed as the final rule of the real time system to classify gambier leaf. The result shows that the combination resulted in a high accuracy of 100% in which the same decision was reached between farmers and the system when 500 leaves were classified.

Sample of Leaf
This study was conducted on gambier leaves from Tarantang Village, West Sumatera, Indonesia. This village is very famous for its gambier production. From discussions with the farmers, the gambier leaves in Tarantang Village are usually picked when they have reached the age of 5 months. The farmers usually use area and color of the leaf to simplify the selection process. Table 1 shows the explanation of color and area of the five grades and their class. Leaves that are old enough are classified as grade 5. This is the only recommended grade to be picked by farmers, yet a few grade 4 leaves are also carried away in the picking process. Grade 1, 2, and 3 leaves are totally forbidden to be picked, because they could degrade product quality.

System Design
A group of farmers with approximately 30 years of experience with gambier plant was asked to classify the leaves into grades 1, 2, 3, 4, and 5. This grade was also related to the age of leaf. The age prediction made by the farmers for grades 1 to 5 were 1 month, 2 months, 3 months, 4 months, and 5 months, respectively. There were 300 leaves in each grade.
A system was designed to predict leaf maturity. The system designed to classify the leaves has four main parts, as shown in Figure 1. The input is the gambier leaf image captured by a camera. The output is leaf grade shown on an LCD. A raspberry Pi as a microprocessor is used to process image features and recognize the grade. A user interface was designed to operate this system on a mini monitor.

Hardware Design
A rectangular box was designed with a dimension of 19 cm by 14 cm, as shown in Figure 2. The electrical components consist of an LCD, a camera, and a microcontroller. They are attached on the top side of the box, and a mini monitor sits beside the box, as shown in Figure 2. Two LEDs are located on two sides facing each other. These two LEDs are 13 cm from the bottom of the box. Each LEDs is

Hardware Design
A rectangular box was designed with a dimension of 19 cm by 14 cm, as shown in Figure 2. The electrical components consist of an LCD, a camera, and a microcontroller. They are attached on the top side of the box, and a mini monitor sits beside the box, as shown in Figure 2. Two LEDs are located on two sides facing each other. These two LEDs are 13 cm from the bottom of the box. Each LEDs is supplied with a 3.6 volt and 150 mA power source. The color temperature is from 6000K to 6500 K with 140 • view angle. A camera is attached on the roof exactly at the center point of the roof (9.5 cm × 7 cm). The camera resolution is 5 MP and the image size is 720 pixels (horizontal) × 480 pixels (vertical). supplied with a 3.6 volt and 150 mA power source. The color temperature is from 6000K to 6500 K with 140° view angle. A camera is attached on the roof exactly at the center point of the roof (9.5 cm × 7 cm). The camera resolution is 5 MP and the image size is 720 pixels (horizontal) × 480 pixels (vertical). A leaf must be placed inside the box to have its picture taken. Figure 3a shows the box cover opened to position the leaf inside the box. Figure 3b illustrates the leaf position on the bottom of the box. This plane has a dimension of 19 cm × 14 cm. The center viewpoint of the camera is at the diagonal line intersection of the bottom side and the starting pixel is the (0, 0) pixel coordinate. An imaginary auxiliary line is used to center the leaf position at the horizontal axis. The tip of the leaf faces toward the viewpoint of the camera. A horizontal pixel is 0.026 cm in length and a vertical pixel has a 0.029 cm length.

Software Design
The software was designed as the interface between machine and human. A user can choose both input types to select the image source and feature to classify the leaf based on the image. There are three available input sources, which are the camera, file, and folder. This process is shown in Figure 4.
File type source is an input that processes an image from a saved image file. It allows the user to processed only one file at a time. On other hand, the folder type input gives flexibility to the user to process multiple files in one processing. The saved image for both file and folder type inputs must be the picture taken using the camera at the top of the box. A leaf must be placed inside the box to have its picture taken. Figure 3a shows the box cover opened to position the leaf inside the box. Figure 3b illustrates the leaf position on the bottom of the box. This plane has a dimension of 19 cm × 14 cm. The center viewpoint of the camera is at the diagonal line intersection of the bottom side and the starting pixel is the (0, 0) pixel coordinate. An imaginary auxiliary line is used to center the leaf position at the horizontal axis. The tip of the leaf faces toward the viewpoint of the camera. A horizontal pixel is 0.026 cm in length and a vertical pixel has a 0.029 cm length. supplied with a 3.6 volt and 150 mA power source. The color temperature is from 6000K to 6500 K with 140° view angle. A camera is attached on the roof exactly at the center point of the roof (9.5 cm × 7 cm). The camera resolution is 5 MP and the image size is 720 pixels (horizontal) × 480 pixels (vertical). A leaf must be placed inside the box to have its picture taken. Figure 3a shows the box cover opened to position the leaf inside the box. Figure 3b illustrates the leaf position on the bottom of the box. This plane has a dimension of 19 cm × 14 cm. The center viewpoint of the camera is at the diagonal line intersection of the bottom side and the starting pixel is the (0, 0) pixel coordinate. An imaginary auxiliary line is used to center the leaf position at the horizontal axis. The tip of the leaf faces toward the viewpoint of the camera. A horizontal pixel is 0.026 cm in length and a vertical pixel has a 0.029 cm length.

Software Design
The software was designed as the interface between machine and human. A user can choose both input types to select the image source and feature to classify the leaf based on the image. There are three available input sources, which are the camera, file, and folder. This process is shown in Figure 4.
File type source is an input that processes an image from a saved image file. It allows the user to processed only one file at a time. On other hand, the folder type input gives flexibility to the user to process multiple files in one processing. The saved image for both file and folder type inputs must be the picture taken using the camera at the top of the box.

Software Design
The software was designed as the interface between machine and human. A user can choose both input types to select the image source and feature to classify the leaf based on the image. There are three available input sources, which are the camera, file, and folder. This process is shown in Figure 4.
File type source is an input that processes an image from a saved image file. It allows the user to processed only one file at a time. On other hand, the folder type input gives flexibility to the user to process multiple files in one processing. The saved image for both file and folder type inputs must be the picture taken using the camera at the top of the box. After choosing the input type, the user can choose the feature to predict the grade of leaf. Three features available on the menu are area, perimeter, and color. In particular, the result from a file or camera input type is available in the detail section. This section provides information about area, perimeter, and color. The grade of the leaf is also shown on this part. The layout of this software is illustrated in Figure 5. After choosing the input type, the user can choose the feature to predict the grade of leaf. Three features available on the menu are area, perimeter, and color. In particular, the result from a file or camera input type is available in the detail section. This section provides information about area, perimeter, and color. The grade of the leaf is also shown on this part. The layout of this software is illustrated in Figure 5.  After choosing the input type, the user can choose the feature to predict the grade of leaf. Three features available on the menu are area, perimeter, and color. In particular, the result from a file or camera input type is available in the detail section. This section provides information about area, perimeter, and color. The grade of the leaf is also shown on this part. The layout of this software is illustrated in Figure 5.

Leaf Features
Leaf features used in this research were area, perimeter, and intensity of the leaf image. The image was produced by a camera installed at the top side of cover box. The image was represented as a bitmap image in jpeg format, which had pixels. The three features were processed from the image pixels. Captured images were saved in Raspberry Pi memory.

Area
The original image is processed using the grayscale method provided by OpenCV. The RGB value is converted to grayscale using Equation (1). After the gray scale image is obtained, the next step is to get the binary image using threshold Equation (2). The threshold value (T) is set to 70. Pixels are labelled "0" for white if the grayscale value is smaller than threshold and "1" for black if the grayscale is equal or bigger than threshold value. The image is divided into two parts, as follows: Area 1 and 2, as shown by Figure 6a,b. Each part has a size of 720 pixels × 240 pixels. The leaf area is calculated using horizontal integral projection for both parts, based on Equation (3) for area 1 and Equation (4) for area 2. The total area for the leaf in the pixel is given by Equation (5).
A 1 = area 1 in pixel A 2 = area 2 in pixel A p = total area in pixel P (i, j) = Pixel label in line i and column j.
The surface area of the leaf is also measured manually for the validation method, as shown in Figure 7. The outline of the leaf is projected on millimeter grid paper. The size of the major square on the paper is 1 cm 2 . There are two types of filled squares, as follows: Full grid (A full_grid and half grid (A half_grid . The total of area (A r ) in cm 2 is the sum of full grid and half grid, as in Equation (6). The full grid total is equal to the amount of full squares (n full_grid ) (7) and the half grid total is the total of the half grid squares divided by two n half_grid 2 ) (Equation (8)).
A half_grid = n half_grid 2 (8) step is to get the binary image using threshold Equation (2). The threshold value (T) is set to 70. Pixels are labelled "0" for white if the grayscale value is smaller than threshold and "1" for black if the grayscale is equal or bigger than threshold value. The image is divided into two parts, as follows: Area 1 and 2, as shown by Figure 6a,b. Each part has a size of 720 pixels × 240 pixels. The leaf area is calculated using horizontal integral projection for both parts, based on Equation (3) for area 1 and Equation (4) for area 2. The total area for the leaf in the pixel is given by Equation (5).
(a) (b) A 1 = area 1 in pixel A 2 = area 2 in pixel A p = total area in pixel P (i, j) = Pixel label in line i and column j.
The surface area of the leaf is also measured manually for the validation method, as shown in Figure 7. The outline of the leaf is projected on millimeter grid paper. The size of the major square on  the paper is 1 cm 2 . There are two types of filled squares, as follows: Full grid (A full_grid ) and half grid (A half_grid ) . The total of area (A r ) in cm 2 is the sum of full grid and half grid, as in Equation (6). The full grid total is equal to the amount of full squares (n full_grid ) (7) and the half grid total is the total of the half grid squares divided by two ( n half_grid 2 ) (Equation (8)).

Perimeter
The Canny method provided by the cv.Canny() function in OpenCV is used to detect the edges of the leaf image. Hysteresis thresholds were declared to be 70 and 150 for minimum and maximum values, respectively. This method converts the original image into a binary image as shown in Figure  8. The black pixels are labeled as "0" and white pixels are "1". Similar to the area procedure, the image is also divided into area 1 and area 2 to calculate the perimeter 1 (Equation (9)) and 2 (Equation (10)), respectively. The total leaf perimeter in the pixel is given by Equation (11).
C p =C 1 +C 2 (11) C 1 = perimeter 1 in pixel C 2 = perimeter 2 in pixel C P = perimeter of leaf in pixel P (i, j) = Pixel label in line i and column j.

Perimeter
The Canny method provided by the cv.Canny() function in OpenCV is used to detect the edges of the leaf image. Hysteresis thresholds were declared to be 70 and 150 for minimum and maximum values, respectively. This method converts the original image into a binary image as shown in Figure 8. The black pixels are labeled as "0" and white pixels are "1". Similar to the area procedure, the image is also divided into area 1 and area 2 to calculate the perimeter 1 (Equation (9)) and 2 (Equation (10)), respectively. The total leaf perimeter in the pixel is given by Equation (11).
C 1 = perimeter 1 in pixel C 2 = perimeter 2 in pixel C p = perimeter of leaf in pixel P (i, j) = Pixel label in line i and column j.
The perimeter of the leaf is also manually measured to validate the Canny method. The leaf is projected to a millimeter grid paper. Then, a string is attached to trace the line on that paper, as shown by Figure 9a,b. The length of string is measured using a ruler. The perimeter of the leaf is equal to the length of the string. The perimeter of the leaf is also manually measured to validate the Canny method. The leaf is projected to a millimeter grid paper. Then, a string is attached to trace the line on that paper, as shown by Figure 9a,b. The length of string is measured using a ruler. The perimeter of the leaf is equal to the length of the string.

Intensity
Image intensity is used to recognize leaf grade. The intensity of the image is calculated using Equation (12). Ten pixels are used as samples for the intensity feature. The coordinates of the ten pixels are set from the lengths and widths of leaves from all grades. Figure 10 shows the ten sample pixels for the image intensity. There are five areas to position them. Each area has two sample pixels. The horizontal line boundaries located on the camera are vertical pixel 230 for Ylow and vertical pixel 260 for Yhigh. The vertical line boundaries are constructed using the horizontal pixel values. Only leaves on grade 5 had ten sample pixels on the leaf. For grade 1, there two sample pixels are located on the leaf and the remaining eight pixels are attached on the background of the image. The completed information about the area vertical boundaries and distribution of the sample locations are provided in Table 2. The perimeter of the leaf is also manually measured to validate the Canny method. The leaf is projected to a millimeter grid paper. Then, a string is attached to trace the line on that paper, as shown by Figure 9a,b. The length of string is measured using a ruler. The perimeter of the leaf is equal to the length of the string.

Intensity
Image intensity is used to recognize leaf grade. The intensity of the image is calculated using Equation (12). Ten pixels are used as samples for the intensity feature. The coordinates of the ten pixels are set from the lengths and widths of leaves from all grades. Figure 10 shows the ten sample pixels for the image intensity. There are five areas to position them. Each area has two sample pixels. The horizontal line boundaries located on the camera are vertical pixel 230 for Ylow and vertical pixel 260 for Yhigh. The vertical line boundaries are constructed using the horizontal pixel values. Only leaves on grade 5 had ten sample pixels on the leaf. For grade 1, there two sample pixels are located on the leaf and the remaining eight pixels are attached on the background of the image. The completed information about the area vertical boundaries and distribution of the sample locations are provided in Table 2.

Intensity
Image intensity is used to recognize leaf grade. The intensity of the image is calculated using Equation (12). Ten pixels are used as samples for the intensity feature. The coordinates of the ten pixels are set from the lengths and widths of leaves from all grades. Figure 10 shows the ten sample pixels for the image intensity. There are five areas to position them. Each area has two sample pixels. The horizontal line boundaries located on the camera are vertical pixel 230 for Y low and vertical pixel 260 for Y high . The vertical line boundaries are constructed using the horizontal pixel values. Only leaves on grade 5 had ten sample pixels on the leaf. For grade 1, there two sample pixels are located on the leaf and the remaining eight pixels are attached on the background of the image. The completed information about the area vertical boundaries and distribution of the sample locations are provided in Table 2.  Figure 10. Designed system of image processing based on RGB color by ten pixel points.

Neural Network
Each feature has its own artificial neural network (ANN) system. There is an input layer (Xi), one hidden layer (Zj), and an output layer (Yk). The hidden and output layer have bias functions bZj and bYk, respectively. The input layer and the hidden layer is connected with weight (cij). The hidden layer and output is weighted by djk. The Logsigmoid function is used for the hidden layer and purelin is the activation function for the output layer. The illustration of the ANN is shown by Figure 11. The output from the hidden layer is calculated using Equation (13) and activated by Equation (14). The output layer produces Equation (15) and is activated by Equation (16).
Y k =B Yk + d jk *OZ j n 1 (15) OY k =purelin(Y k ) (16) Figure 10. Designed system of image processing based on RGB color by ten pixel points.

Neural Network
Each feature has its own artificial neural network (ANN) system. There is an input layer (X i ), one hidden layer (Z j ), and an output layer (Y k ). The hidden and output layer have bias functions b Zj and b Yk , respectively. The input layer and the hidden layer is connected with weight (c ij ). The hidden layer and output is weighted by d jk . The Logsigmoid function is used for the hidden layer and purelin is the activation function for the output layer. The illustration of the ANN is shown by Figure 11. The output from the hidden layer is calculated using Equation (13) and activated by Equation (14). The output layer produces Equation (15) and is activated by Equation (16).
The number of neurons for each layer is shown by Table 3. The area and perimeter features, respectively, have two ANN inputs. The area feature uses area 1 and area 2 as the input and the perimeter feature utilizes perimeter 1 and perimeter 2 as the input. The intensity feature uses ten inputs, which are the ten sample pixels. Three binary output neurons as the representatives of the The number of neurons for each layer is shown by Table 3. The area and perimeter features, respectively, have two ANN inputs. The area feature uses area 1 and area 2 as the input and the perimeter feature utilizes perimeter 1 and perimeter 2 as the input. The intensity feature uses ten inputs, which are the ten sample pixels. Three binary output neurons as the representatives of the amount of cluster are selected for the output layer. The relationship between the output condition and the grade is shown by Table 4. There were 1000 training data sets used to build neuron weight and bias. There were 500 data sets for test sessions. Each grade had 100 data sets to test. The ANN was trained using MATLAB Software to get the weight and bias. The performance of the trained ANN was evaluated based on the accuracy.

Hardware and Software
The implementation of hardware design from front and top view is shown by Figure 12a,b. This tool is shaped like a box with black color to prevent light from outside. The user can operate this tool through a user interface application. The example results of this application are shown by Figure 13a for grade 1 and Figure 13b for grade 5. There are options for input and feature. The user can see the detail and grade of the leaf.

Leaf Features
Area and perimeter of each leaf were obtained from both manual and the image processing method. The data are shown in Table 5. Mean values of area and perimeter from 1500 leaves are given for both manual and image processing. The absolute difference between image processing and the manual method results is stated as error (%). The extent of data to give information about data distribution is defined by standard deviation (SD). The maximum error in area was 2.76 cm 2 for grade 3. However, in percentage, grade 1 gave the largest error in area at about 5.25%. The image processing method to calculate area best worked for grade 5, with only 1.43% error. On average, the error in area calculation was about 3.68% for the five grades. The opposite situation occurred in the perimeter feature, when the smallest error occurred in grade 1 at 5.20%. The average error for perimeter calculation using image processing in all grades was 1.74 cm or 5.98%.

Leaf Features
Area and perimeter of each leaf were obtained from both manual and the image processing method. The data are shown in Table 5. Mean values of area and perimeter from 1500 leaves are given for both manual and image processing. The absolute difference between image processing and the manual method results is stated as error (%). The extent of data to give information about data distribution is defined by standard deviation (SD). The maximum error in area was 2.76 cm 2 for grade 3. However, in percentage, grade 1 gave the largest error in area at about 5.25%. The image processing method to calculate area best worked for grade 5, with only 1.43% error. On average, the error in area calculation was about 3.68% for the five grades. The opposite situation occurred in the perimeter feature, when the smallest error occurred in grade 1 at 5.20%. The average error for perimeter calculation using image processing in all grades was 1.74 cm or 5.98%.    Figure 14a shows the trend of area from grade 1 to grade 5 and Figure 14b gives the information about perimeter. Both the manual and image processing method gave similar trends in area and perimeter. The leaf area and perimeter features are linear to the grades. It indicates that the gambier leaf age in Tarantang Village grows gradually from 1 month to 5 months old.
Electronics 2019, 8,1308 12 of 19 Figure 14a shows the trend of area from grade 1 to grade 5 and Figure 14b gives the information about perimeter. Both the manual and image processing method gave similar trends in area and perimeter. The leaf area and perimeter features are linear to the grades. It indicates that the gambier leaf age in Tarantang Village grows gradually from 1 month to 5 months old. Each feature had its own neural network system. The designed networks were trained using 1000 datasets. Table 6 shows the training performances of three features. The difference between the

Training Performance
Each feature had its own neural network system. The designed networks were trained using 1000 datasets. Table 6 shows the training performances of three features. The difference between the target and neural network outputs was stated by the mean square error (MSE) as a performance indicator. Neural network training for the intensity feature gave the best performance compared to others and area training resulted in the lowest accuracy. Perimeter had better accuracy than intensity, but the training process required the longest time. The training process resulted in weights and bias as constant variables to calculate output. There were two neurons in the input layer, five neurons in the hidden layer, and three neurons in the output layer for area and perimeter features. Input weights for area and perimeter features are given in Table 7 and layer weights for both features are provided in Table 8. Bias variables for the hidden layer and output layer are given in Table 9. The neural network for intensity had ten neurons in the input layer, twelve neurons in the hidden layer, and three neurons in the output layer. The neural network input weights for the intensity feature are provided in Table 10. There were 120 input weights and 36 layer weights generated for this system, as shown in Tables 11 and 12, respectively.

Testing Performance
Each feature was tested using 100 data for each grade. So, there were 500 testing data. The results for area, perimeter, and intensity features are shown in Tables 13-15, respectively. The area feature could make predictions with 100% accuracy for only the lowest grades. This feature made 5 different decisions when it grouped five leaves to grade 3 instead of grade 2, as with the farmers' recommendation. The same number occurred when area feature put five leaves into grade 2 instead of grade 3, as with the farmers' recommendation. The perimeter feature was better than the area feature in predicting grade 4 to grade 5. There was no difference between neural network decision using the perimeter feature and the farmers' recommendation for grade 4 to grade 5. The average accuracy for area was 93%. Perimeter had a better accuracy at 96%. The neural network system for intensity of ten sample pixels only made mistakes in classifying grade 2. This feature had 100% accuracy for grade 1, 3, 4, and 5. The intensity feature performance can cover the disadvantages in area and perimeter.      These results show the potential of the three features to help the farmers with deciding whether a leaf is ready or forbidden to be picked. A set of rules was developed using three investigated features to configure the algorithm to decide the status of a leaf, as shown in Table 16. This algorithm was introduced into the designed tool for a real time application for leaf grading. The resulting decision using this algorithm was 100% the same as the algorithm built based on the skill of farmers, shown in Table 1. Table 17 shows the comparison between the proposed method and others. This research was conducted to assist with local agriculture problems. It grades gambier leaves from Tarantang Village as the object. This is a famous village in Indonesia with a gambier commodity. A tool was designed with a box shape with a camera to take the image. Two LEDs with a 6000 K to 6500 K color temperature were activated for the light setting inside the box. Image processing was run to recognize whether a leaf was ready, recommended, or forbidden to be picked. The image size was 720 pixels × 480 pixels. The three features were area, perimeter, and intensity. The combination of these features was also investigated. A backpropagation neural network was used to build the classifier method. The result shows that the combination of these features using the backpropagation neural network had a significant performance in grading gambier leaves.  [28] Centroid Radii 100% Plantscan dataset [28] Moment Invariant and Centroid Radi 100% Leaf [29] Leaf Contour Convolutional Neural Network 94% Herbal Leaf [20] Shape Euclidian 86.67% Canberra Distance 72% Gonzales dataset and Wood website [30] Leaf area, circumference, centroid, major axis length, minor axis length

Conclusions
Gambier leaves in Tarantang village were classified based on farmers' knowledge into three class; namely, recommended, available, and forbidden to be picked. Five-month-old gambier leaves are recommended to be picked and four-month-old gambier leaf are available to be picked. Younger gambier leaves are forbidden to be picked. Farmers' ability to classify the gambier leaf were reproduced using three artificial neural networks for each feature of area, perimeter, and intensity. The results show that the neural network with the intensity input was the most accurate system, with a 97% accuracy. The area and perimeter features resulted in 93% and 96% accuracy, respectively. Based on that performance, a set of grading rules was determined using the combination of three neural networks. The recommended class is only given to leaf with an intensity grade of 5 and other features have grade ≥ 4. The leaf is forbidden to be picked if the intensity grade is lower than 5. Those rules can give 100% accuracy to cluster gambier leaves, compared with farmers' knowledge in this village.