Electronic Honey Quality Analyser

The detection of adulterated honey is a considerable challenge in the Sri Lankan context. The usual practice is to independently check the different parameters in order to determine the quality of a given honey sample. However, measuring and employing a single parameter for the classification reduces the accuracy of the classification. Thus, in this paper a multi-parameter based honey quality classification is proposed to ensure a better accuracy. The design of a parameter detector and a classifier which can automatically complete the classification of a given sample is also presented. This classifier operating on support vector machines is first trained using an array of honey samples obtained in Sri Lanka. The resultant classifier shows a high level of accuracy of 97.5% for the randomly selected test sample set. The proposed system is a handy tool for accurate, quick, low cost and simple honey quality checking.


Introduction
Honey is a sweet substance produced by several sub-species of bees which consists of floral extracts as well as secretions from bees. Over the centuries, honey has been an essential ingredient in traditional medicines around the world [1]. In recent times, there had been a high interest on honey, it being a cure for many chronic diseases prevailing today. Furthermore, honey is considered as contributing to weight loss and enhancement of skin complexion. Thus it is a preferred ingredient in many beauty-care products. Meanwhile, the bee-keeping industry in many parts of the world has been facing a decline due to lack of labour and also due to its low profits. Thus to cater to the demand, there are many fraudulent techniques that are being practiced by the adulteration or simulation of honey. The addition of water and other chemicals is done very frequently. Too much water will make the honey to ferment very quickly while the chemicals added to it can be harmful to the human body. Furthermore, the medicinal characteristics of honey deteriorate when there are impurities in it. There are many techniques that measure the quality of honey. In these measurements, a few parameters have been identified as being the most critical and influential in determining the quality of honey namely, the water content, sugar content, acidity, Hydroxymethylfurfuoral (HMF) value and the ash content [2,3]. The water content in honey is a parameter that directly influences its fermentation. A water content below 20% is strictly preferred in bee honey production. A high sugar content is also an indicator of the superior quality of honey.
Adulteration would result in making the sugar content to deviate greatly from the preferred percentage of 82%, which in turn will increase the probability of fermenting. Meanwhile, the acidity is also an important parameter for defining honey quality. Due to the presence of an array of floral acids, honey has a natural pH value ranging from 3.4 to 5.0. Any deviation would reduce the medicinal quality of honey as well as its flavour profile. HMF is a chemical substance present in honey. High HMF values can also result in acidic honey which will in turn reduce its medicinal values. At the same time a higher acidity will reduce bacterial action, thereby reducing the probability of fermentation taking place. Furthermore, the ash (mineral) content is also important in determining the quality of honey with a high ash content leading to dark honey which will be less preferable. However, the ash content is not directly measurable. Nevertheless, the conductivity of honey is proportional to its ash content. As the amount of minerals in honey increases, it becomes more conductive which can be made use of in determining the quality of honey in terms of mineral content. Therefore, measuring these parameters in a given honey sample followed by a classification would be able to indicate the quality of the honey.
Although, no dedicated honey quality testing machine capable of measuring all the aforementioned parameters together at once is available, many types of individual honey parameter value testers are available in the market. Gas Chromatography (GC) and liquid Chromatography (LC) analysis help to determine the sugar content in a given honey sample, thereby facilitating the prediction of the probability of fermenting [4]. Near Infrared Transfectants Spectroscopy (NIRTS) also focuses on determining the fructose content in honey which in turn can predict the degree of adulteration [5]. Fourier Transform Infrared Spectroscopy (FTIRS) with Attenuated Total Reflectance (ATR) [5] is also a widely employed technique to determine the adulteration by corn syrup or beet invert. Liquid Chromatography coupled to Isotope Ratio Mass Spectrometry (LC-IRMS) is also capable of differentiating in a very short time, pure honey from adulterated honey [5]. Calorimetric methods are also very popular and powerful techniques that distinguish pure honey from adulterated honey. Meanwhile, the ash content, colour and many other parameters are dependent on the geography where it is found. From area to area, depending on the rainfall and the type of flora available, honey can possess different parameter values and also their effect on classification will vary [6]. Hence, an intelligent pattern recognition approach is required for a proper classification of the quality of the honey. Moreover, a joint classification based on a multi-dimensional parameter set could be expected to produce a better classification. In this paper, the design steps of an electronic honey parameter detection system and a quality classifier system are presented. In Section 2, the sensors for detecting different parameters are presented. Section 3 describes the details of the support vector based classifier followed by Section 4 which presents the prototype implementation & testing. Test results are listed in Section 5 and Section 6 concludes the paper highlighting a few research directions for the future.

Absorption Sensor
At constant temperature, the light absorption property of honey will vary with the amount of water present in it. This property can be utilized to measure the water content in a given honey sample as shown in Figure 1.

Figure 1 -Water Content Sensor
If the system is calibrated to be used at room temperature, a light beam with a given intensity can be transmitted through the honey sample to be collected by a photo detector. The photo detector output is amplified with an amplifier having a known gain. Thus, the amplifier output signal will be proportional to the light output from the honey sample. This in turn is correlated to the light absorbance of the honey given by, where and refer to the voltage output of the amplifier when light passes through air and when it passes through the sample, respectively. Moreover, as already mentioned, the honey colour may differ from area to area and from one flora type to the other. Therefore, in order to reduce the dependencies between the colour of the sample and the light absorption, frequencies in the Infra Red (IR) range are employed. Through the experiments it was clear that the selected light frequencies perform the classification much superior than when using visible light.

pH Meter
A pH meter is a device which can measure acidity in terms of the concentration of the Hydrogen ions (H + ) present in an aqueous solution. Usually, a pH meter uses the potentiometric principle where two electrodes are submerged in the solution under consideration ( Figure 2) [7]. One electrode will consist of a very thin glass bulb filled with Potassium Chloride (KCl) with a Silver Chloride (AgCl) element submerged in KCl. Furthermore, the H + ions are capable of creating an effect through the thin glass bulb to the inside of the bulb. A potential is built in the AgCl element due to the difference of the pH value in inner and outer liquids. The other is a reference electrode which is also having a glass bulb filled with KCl with a Mercuric Chloride (HgCl) element submerged in KCl. However, the reference electrode consists of a porous ceramic membrane between the inner and outer solutions which allows for the passing of H+ ions. Hence, it builds a reference potential. Whenever the two electrode arrangement is placed inside a solution, a potential difference will appear across the two AgCl and HgCl elements which will be proportional to the pH value of the unknown solution.

Conductivity Tester
A conductivity tester comprises of a pair of electrodes placed at a fixed separation and submerged in the solution. Furthermore, the tester will have current and voltage measuring circuit elements as shown in Figure 3.

Figure 3 -Conductivity Tester Circuit
A series of constant frequency current pulses are supplied to the circuit from the current source and the variable resister is adjusted to have an approximately as the voltage across the probe submerged in the solution under test. These voltage signals are amplified and utilized for the calculation of the conductivity. Let the voltage outputs at the current and voltage measuring units be and respectively and also let the adjusted variable resister value be ; then the current flowing through the probe will be given by,

…(3)
Thus, with the distance between the electrodes and the effective cross section of the electrodes being , the conductivity will be, .

…(4)
The conventional probe with only 2-pole electrodes will capture both the liquid resistance and the resistance appearing due to bubbles at the electrodes. This value of the total resistance obtained is different from the actual resistance due to the resistances of the electrode-liquid contact. Hence to overcome this issue, 4-pole electrodes are commonly used [8].

Support Vector Machine Classifier Training
A Support Vector Machine (SVM) is a supervised learning technique for classifying a set of test data in to two groups. Let represent a set of training data points where is a multi-dimensional data set representing the captured parameters of a certain honey sample.
is the class to which each sample will belong to. (Eg. Good quality or not).
The task will be to calculate the maximum margin of separation between the two classes such that two parallel hyper planes dividing the two classes will maintain the maximum distance between them. The maximum margin hyper plane: where w and b are to be determined to maximize the separation between the two parallel hyper planes and (Figure 4) Finally the maximization will reduce to minimization of under the constraint . w and b which solve the above minimization problem form the maximum margin hyper plane. However to reduce the mathematical complexity, the minimization is carried out for complexity, the minimization is carried out for .
On the other hand, the classification boundary can be non-linear. In such instances, a transformation of the feature space to a higher dimension will be carried out. However, in this study a linear classification was assumed for simplicity and it was observed that a linear classifier performs adequately in honey quality classification.
For the constrained minimization problem a Lagrange can be formed as,
Note that is a function of s only. According to the Duality Theorem, the solutions that minimize would also minimize Thus, yields, and , for all .

…(13)
With support vectors selected, (13) will result in equations which can be summarized as,

…(14)
where and is a dimensional square matrix which is to be determined via the support vectors. Thus,

…(15)
Furthermore, with the resolved (10) and for any support vector index yield the and parameters. The classifier can be then stated as,

Prototype Implementation and Testing
A prototype system was implemented ( Figure  5) for obtaining the parameter values and also training for a support vector machine based classification. The developed prototype was capable of measuring three parameters, water content via light absorption, pH value and the conductivity which cover the set of parameters discussed in Section 1. The pH tester was selected to be SEN00600 Grove pH sensor module [10] due to its low power consumption and also because of the cost-accuracy trade off. The tester was calibrated with a known acidic solution. Moreover, the conductivity tester was implemented with a four pole sensor arrangement. This selection is supported by the high linearity of the tester and also the fact that a wide range of conductivities are measurable by eliminating the introduction of additional resistances to the measurements. The other important circuitry is the absorbance of light measuring unit for which an integrated reflective sensor unit, TSL-12S has been selected [11].

Figure 5 -Prototype Implementation
As mentioned earlier, the light absorption greatly depends on the temperature. Therefore, it is vital to maintain a pre-agreed fixed temperature. To facilitate this requirement, an LM35 based temperature sensor was employed.
The absorption tester was also calibrated for the water content value based on the corresponding value of a pre-known honey sample. A support vector supervised training was carried out for 40 randomly selected honey samples collected from around the country by the Ayurvedic Research Centre of Sri Lanka and the quality of the samples was separately assessed by the experts. Decision boundary parameters were included in a flash memory and an Arduino-Mega control board was employed for the control.

Light absorption sensor
Conductivity tester pH meter Classifier Class (Good / Bad)

Figure 6 -Prototype Classifier Functional Block Diagram
The classification in the honey quality analyser implemented as in Figure 6 was based on the rule: .. (17) Furthermore, 40 other samples were used in testing the accuracy of the classifier.

5.
Results and Discussion Figure 7 shows, the good quality honey samples in red and the bad quality ones in blue. It is apparent that the samples are dispersed equally in the pH dimension and that the pH value is not much correlated to the quality of honey. On the other hand, the two parameters namely, water content and the conductivity show a strong correlation to the quality of the honey ( Figure 8). Thus, the classification was restricted to a 2-D plane with water content and the conductivity being the two parameters considered. Water content (%)

Figure 9 -Decision Boundary
Let five support vectors on the potential boundary be, boundary be, .
With these support vectors, .
This represents a straight line with a gradient of and an offset as shown in Figure 9. The results obtained after utilizing the derived parameters and the rule in (17) to classify 40 test samples are shown in Table 1 and they demonstrate a very accurate classification. The accuracy of the electronic honey quality analyser Classification accuracies for several existing honey quality classifiers are listed in Table 2 [12,13]. Even though the test sample set, its size and sample properties do not match the Sri Lankan sample set that was considered, it is apparent that the multi-parameter based support vector classification performs better than any of the existing schemes.

Conclusion and Future Work
This paper has presented a study of the deciding factors for quality in a given honey sample obtained in Sri Lanka. It was observed that the selected parameter pH is independent of the quality of the honey while the quality is correlated to light absorption (water content) and conductive properties of the honey. Furthermore, this paper has presented the Water content (%) Co nd uct ivi ty (m S) hardware setups required to capture the three considered parameters. The paper also proposes an electronic honey quality analyser which is capable of classifying a given honey sample according to its quality. The classification technique employed, the support vector machine is identified as one of the best performing techniques when the training data set is fairly small. This was confirmed by the very high accuracy obtained for the collected honey samples. One of the major drawbacks in testing scarce food items such as honey is the inability to have a fairly large set of training samples. Even though a 97.5% accuracy was obtained for 40 test samples, in testing a larger set a lesser accuracy may result. However, a larger set would also enable to employ more advanced techniques such as neural networks which can be expected to yield better overall accuracies.