An Application of SURF Algorithm on JAKIM’s Halal Logo Detection

Halal logo plays an important role in influencing Muslim consumer’s level of confidence in the Halal status of a product. However, certified Halal logo can be easily manipulated. Besides, detecting and recognizing the credibility of the logo is visually challenging without any computer-vision assistance. Therefore, an automated system is indeed in need to detect and verify the authenticity of the logo. This study proposed the application of Speeded Up Robust Features (SURF) algorithm in detecting various images of Halal logo, which then was matched with the reference image of certified Halal logo by JAKIM. Accuracy rate of the detected image was then calculated. A total of 100 images of certified logo and fake Halal logo gathered from various resources were used. Testing set which are independent of the training set were used and managed to attain 85.71% of accuracy rate. The experiments show that the proposed method achieved the desirably good result and was able to be at par with other existing methods.


Introduction
The Halal logo has become one of the decisional factor in purchase of Halal products as consumers always see halal logo as a symbol indicating those products or business is certified by the Islamic body authorities (Sunaryo, 2018;Adila & Fatya. 2020). This symbol reflects that the product or business is Syariah compliance and therefore is permissible for the Muslims. In Malaysia, Jabatan Kemajuan Islam Malaysia (JAKIM) hold full authority in issuing Halal certification.
In addition, for a product to be certified Halal by JAKIM, the product itself has to fulfil certain requirements that has been stated by the Syariah law. According to the Syariah law, the entire ingredients used in the product has to be permitted; the food or any parts of the product are free from the non-Halal animals and animals that are not slaughtered. Other than that, the product or food must also be free from any 'Najs' (excrement), safe and not harmful to be consumed. The product must also be free from any parts of human body. In addition, the manufacturing equipment involved during the preparation process must not be contaminated with excrement. During the preparation, process or packaging should not be in contact or placed near to any food that does not meet the requirement or any substance that is considered as impure by the Islamic law. Only when the product has met the entire requirements, then the product is subjected to the certification and a Halal logo will be issued to it (Halal Malaysia, 2021). Due to this strict requirements, certified products are presumed to hold the best quality, reflected by the Halal logo.
Normally, consumers do recognize the Malaysian Halal logo issued by JAKIM (Masnono, 2005;Rezai, 2008). Whenever the logo presents on the products' packaging, the consumers become more confidence to consume the product. However, there are consumers who are not able to recognize the current logo issued by JAKIM. This was revealed by a study conducted by Ismail et. al (2016) which stated that most of the respondents chose Figure 2(a), instead of Figure 2(b) because of the presentation of 'Jabatan Kemajuan Islam Malaysia' wording, even though the logo has no longer be in used.   (Ismail et. al, 2016) Recognizing an authentic Halal logo issued by JAKIM is visually challenging. Any exploitation or even simple manipulation to the logo can be deceiving, since the consumers are lacking of the information about the genuine Halal logo (Shafiq et. al, 2015). Hence, this has led the consumers, not only to fall into wrong information, but also false conclusion. Therefore, an automated system needs to be established to facilitate the consumers in recognizing the Halal logo issued by JAKIM. Figure 2. Examples of fake halal logo (Xia and Zhou, 2008) Logo detection module has been widely discussed over the years. Learning-based logo recognition method using scale invariant feature transform (SIFT) algorithm for detecting and do classification on logo has been proposed by Xia and Zhou (2008). In the first place, the filter coordinating arrangement is connected in an arrangement of preparing information to dependably recognize the interest area in image and concentrate the segregate highlights, which is utilized as the mark of each logo. Secondly, the estimated closest neighbour looking procedure is developed by planning the information into tree-based structure, with the end goal of productive coordinating. Finally, to perceive the logos in test image, the comparing SIFT elements will be registered in the interest areas of test pictures and coordinated in the database, which is accomplished in the preparation stage. While this method is good in the determining accuracy rate, the process in P4 machine however takes a little bit time. Yang et. al (2013) proposed the efficient logo location and recognition method. Situating logo from coarse to fine, it then decides logo class in light of Discrete Cosine Transform (DCT)'s low-recurrence qualities. After that, Support Vector Machine (SVM) classifier perceives the vehicle model in view of the logo. The piece-wise painting algorithm (PPA) was used by Aleai and Delalandre (2014) to detect logo-patches, together with some probability features and decision tree. To recognize the logo detected in every patches, a template based recognition approach was used. In this approach, a search space reduction technique was applied to reduce the number of template logo-models needed in recognizing the logo-patch detected. The features used for searching space reduction were based on the geometric properties of a detected logo-patch.
Specifically, for Halal logo recognition, Saipullah and Ismail (2015) indicates that 1D Fourier needs to be transformed to each fraction of the 2D Halal logo image. To achieve that, 2D image needs to be converted to 1D array. Meanwhile, to classify the image, K-Nearest Neighbour (KNN) classification method is applied to this system. To detect the features of Halal logo issued by JAKIM, Khairul Amirin et. al (2020) studied three different edge detectors namely Canny, Robert and Prewitt and suggested that images retrieved from digital camera needs to undergo pre-processing to increase the contrast and remove noise in the image before being fed into the system as an input for further process. Mohd et. al (2008) used neural network as the classifier. The networks were trained in three separate sections: Input layer, Hidden layer, and Output layer. Then the correlated inputs were classified into categories that were linearly separable.
Speeded Up Robust Features (SURF) has displayed quick and execute interest point of recognition depiction plan, in which SURF calculation beats the current best in class, both in velocity and exactness. The descriptor is effectively extendable for the representation of relative in various districts (Musale, 2015). Prashar and Kundra (2015) used SURF to match feature points of training and test images. From the results of feature points, SVM classifier was applied and it classified images. Since SURF is able to execute accurate results faster than any other methods, it is best applied on the Halal recognition module that will be developed. Hence, this study was intended to matching up feature points of training with reference image by applying SURF algorithm on the Halal logo images.

Methodology
The detailed process flow for application of SURF algorithm on HALAL logo detection is shown in Figure 3. The process is started with Halal logo image input. The image is then pre-processed before proceeding into the detection module which consists of image converting and edge detection. The image is then undergone SURF recognition module. Finally, the performance evaluation takes place to assess SURF algorithm's ability in detecting the Halal logo images.

a) Image Acquisition
A total of 100 images of certified logo and fake Halal logo gathered from various resources were used. As shown in Figure  4, there is an eight cusp stars at the centre of the circle of Halal logo issued by JAKIM, with an Arabic word which is ‫ل"‬ ‫"ﻶﺣ‬ in the centre of the star. Beneath the Arabic word, it must have "HALAL" word which is in Roman alphabets and a circle shape of the logo. Meanwhile, the "Malaysia" word in Roman must be on top of the circle and ‫ﻣﻟﺎﯾﺰﯿﺎ‬ in Arabic at the bottom. The logo must consist 2 small five cusp stars that splits up both of the word (Halal Malaysia, 2021).

) Image Pre-processing
Images with background made processes of detection would be more complex. The system cannot crop properly. To solve the problem, after the image had been successfully loaded into the system, the image was corrected in terms of brightness at +70 and -15 contrast. After the adjustment adjustment made for the normal image, Gaussian Blur would take place and the 5-pixel effects were put in order to assist with the cropping process.

c) Detection Module
The process of image conversions from RGB format to grayscale format and to binary format were done by using threshold method as shown in Figure 5. Canny Edge Detection was later used to remove the outline area in the image into regions. Algorithm of Canny edge has 5 step which include smoothing the edge, finding gradients, determining the non-maximum and suppression, double thresholding and edge tracking by hysteresis. Fig. 6 shows an example of an image undergoing Canny Edge algorithm.

d) Recognition Module
SURF is a local feature detector and descriptor that can be used in recognizing objects or 3D reconstructions. SURF descriptor can be used to locate and recognize objects, people or faces, to make 3D scenes, to tract objects and to extract points of interest.
SURF algorithm has two main parts: interest point detection, local neighbourhood description and matching. Square-shaped filters are used as an approximation to smoothing the Gaussians. Squaring the image for filtering process is much faster if the integral image is used, in the form of: The sum of the original image within a rectangle can be evaluated quickly using  (Razali et. al, 2015). The Hessian is defined as follows: To classify the maxim and minim of the function, the discriminant value is used. The description starts by assessing the primary direction of the features. This way, the detected image could be rotated accordingly, and hence both images were aligned in regard to that features. For this purpose, the feature has to be rotationally invariant. The resulted feature vector is then calculated based on the pixel in this region (Mohd et. al, 2008).

e) Performance Evaluation
The training and testing datasets were split in a 70:30 ratio, with each dataset weighing in at 18 and 12 respectively. The Halal logo detection testing results were presented using a confusion matrix. Based on the confusion matrix obtained, the respective values of the true positive (TP), true negative (TN), false positive (FP) and false negative (FN) were obtained. The detection accuracy, sensitivity, and specificity rate were computed using Eq. 1, Eq. 2, and Eq. 3 respectively.

Results and Discussion
A total of 35 Halal logo consisted of the Certified logo issued by JAKIM and fake logo were tested. The confusion matrix constructed from the results of accuracy testing is depicted in Table 1.  The values represented in the diagonal pattern in Table 1 reflected the correct Halal logo detection. It can be observed that out of 25 certified logo images, 22 were correctly detected as certified logo whereas another three images were incorrectly detected as fake logo. 8 out of 10 fake logo images were accurately identified as fake logo, while the other two images were misidentified as certified logo.
The confusion matrix summary for Halal logo is shown in Table 2. It can be seen that 30 out of 35 images had been correctly identified, in which 22 were the certified logo, and the other 8 were fake logo. However, there was still a small number (3 of the certified logo and 2 of fake logo) had been misidentified.  The percentages of accuracy, sensitivity, and specificity were computed and then were presented in Table 3. Both certified and fake Halal logos returned the equivalent percentages for accuracy at 85.71%. On the other hand, the certified logo managed to produce a higher percentage of sensitivity at 91.67%. The fake logo however returned a considerably lower sensitivity rate at 72.72% due to a quite high number of false negative rate. For specificity, the fake logo recorded relatively higher percentages at 91.67%, as compared to certified logo that only returned 72.72% of rate. The overall mean percentage of accuracy, sensitivity, and specificity demonstrated a slightly encouraging rate which are 85.71%, 82.20%, and 82.20% respectively.

Conclusion
This study discussed the detection of certified Halal logo issued by JAKIM by applying SURF algorithm where two types