Integration of smartphone technology for maize recognition

The study of android based maize assessment was done by involving two popular machine learning software i.e. teachable machine and android studio. The classification model was performed in online teachable machine learning while interface generation was performed in android studio. Various maize tassel from male, female and contamination plants were collected and used for training and model validation. The results indicated that Android-based tassel classification was successfully applied to the study area with accuracy of 80.7%. In addition, the error of classification was 19.3%, a relatively lower values for large testing datasets. Several mis-classification were found particularly at similar tassel shape. The integration of the model with smartphone technology enables rapid recognition of off-type plant at real-time, even though operated by personnel with limited skills or no knowledge seed technology on maize parental lines ideotype.


Introduction
In recent decades, the use of technology, one of which is mobile technology has become a necessity in society that provides convenience in carrying out activities, supports productivity and precision in the field assessment. Among the popular mobile technology is a smartphone. The user can get information in an Android-based application that is applied to a mobile smartphone. Android is one of the most popular operating system platforms for the community because of its open-source nature so that it allows users to develop.
Machine and deep learning in combination with modern computer [1][2] have significantly change the way of applying precision agriculture by providing the ability to provide a deeper technical and economical farm management [3], preserve natural resources [4], minimize nutrient use [5], and identify disease in crops from aerial sensing data. Singh et al. [6] introduced the idea of using a genetic algorithm to perform segmentation, which proved effective when performed on many images of naturally occurring plants. Later work by Maheshwary et al [7] demonstrated effective methods for disease detection in plants utilizing a dataset consisting entirely of naturally occurring plant images, as opposed to cropped or uniformly oriented images, yielding a detection accuracy of 83.3% This study aims to design an android application that contains information from several types of maize tassel using deep learning so that the system can recognize correct tassel in real-time as an implementation of machine learning on an android smartphone. In this study, Tensor flow lite is used as a library in programming languages. Tensor flow is the second generation of artificial intelligence  [8]. The use of Deep Learning technology in classification results in a high level of classification performance [9].

Methods
The research was conducted in 2020 in Maros Experimental Station, Indonesian Cereals Research Institute. Three lines and varieties were planted including G102612, Mal 03 and other lines. Image of corn tassel was taken during the pollination, approximately 52-58 days after planting. As many as 560 images of G102612, 560 images of Mal 03, and 560 images of contamination plants were captured. The images were then classified into only 3 categories i.e. male tassel, female tassel and contamination tassel. Maize expert or technicians were involved in the selection of the original tassel of each group. All images were collected in separate folder and transformed into 250 x 250 px image size without cropping. The model parameters were kept at default parameters of teachable machine as: epoch= 50; batch size= 32; learning rate= 0.001.
All raw images were processed in two popular application i.e. google teachable machine and android studio. All these software is available as open source software and free to download. Smartphone based tassel classification model was assessed of its accuracy by comparing the correctly classified tassels and total tassels used in the experiment.

Model development and deployment
Teachable machines is a web-based resource helps user to make machine learning projects in a simple and easy way and it is also open source as well as no prior requirement of coding. Teachable machines version 1.0 that is its first version enables webcam to train computer and recognize the pictures and tensorflow version 2.0. TensorflowLite is a framework from Tensorflow which is devoted to applications in Android to enable a more complex model execution. This machine can also be used to upload images from the computer to train it. Furthermore, this machine also works for image based classification sound classification Machine learning application was created by integrating teachable machine and android studio. Firstly, we need to train the model by using google teachable machine to differentiate each tassel. As many as three groups were created i.e. male group, female group and contamination groups. Up on the completion of the group data image, the model was processed into training which take 50 epochs to complete, enables efficient lite model development. The process of model training is shown in Fig. 1.  Due to the limitation of smartphone specifications as compared to the PC will slow data processing of deep learning model. Thus the model should be quantized after training to reduce hardware accelerator latency, processing, power, and model size with little degradation in model accuracy. These techniques can be performed on an already-trained float. The resulted model was then exported through tensorflow lite for further processing, followed by download of quantized model.

Figure 2. Development of teachable machine based classification
The resulting Tensorflow Lite model was imported into the Android Studio Software for display on Android Smartphone. Conversion of the model into android application was done by involving the Android Studio Software developed by Google. The conversion will make the application will only work on android devices. The model was first connected to the path followed by adding a new label finding path labels.txt which we have and then for mobile-net. After making several changes of tensorflow model and text, the project should to be built again. The last process to complete the classification application on android is to connect the smartphone to the machine followed by installing the application on it.

Field implementation of android technology
The detasseling activity in the hybrid maize seed production process only lasts for a limited time, usually between 5-10 days after the tassel heading. Therefore, the use of real-time mobile applications is needed to identify the off-type lines so that the purity of the seeds produced can be maintained. The implementation of android smartphone or real-time mobile technology for the classification tassel type of hybrid maize parent lines was carried out by using the integrated Tensorflow framework Keras and the Android Studio Version 3.6.2.
In the early stages of deployment in the Android smartphones, the image dataset and image class label of the parent lines being tested were trained using teachable machine. After carrying out the training process, the model was generated for the classification of line types. Next, the resulting model was transformed into the Tensorflow Lite (tflite) form using the Tensorflow Lite Converter. Screenshot captured in the field for hybrid maize parental lines are depicted on an Android Smartphone as shown in Figure 3 and Table 1.In addition, results of in-field evaluation of android application is shown in Table 2.  A004  0  0  1  True  A005  0  1  0  True  A006  0  0  1  True  A007  1  0  0  True  A008  0  1  0  True  A009  1  0  0  True  A010  0  0  1  True  A011  0  1  0  True  A012  0  0  1  True  A013  0  0  1  True  A014  1  0  0  True  A015  0  0  1  False  A016  0  0  1  True  A017  1  0  0  True  A018  0  0  1  True  A019  0  0  1  False  A020  0  1  0  True  A021  0  0  1  True  A022  1  0  0  True  A023  0  1  0  True  A024  0  0  1  True  A025  0  1  0  True The smartphone application is user friendly and its application in the field does not require expertise in plant breeding or seed production technology. Screenshot captured during the detection of off-type lines in the field is displayed on an Android smartphone as shown in Figure 3. In addition [10] reported on the successful ;use of Android smartphones with the integration of tf-lite to MobileNet Google to classify rice and had high predictability results. Android-based rice classification and counting were also successfully applied by [11] with an error rate of less than 2%. The Android maize detection application depicted the class labels as well as the confidence probability of the types of lines detected. Based on the results of real-time testing in the field, to produce high predictive accuracy (80,7 % accucary in average) and minimize detection errors, field roguing is recommended to be carried out when the tassels have completely come out but not yet broken (3-5 days after tassel heading). Besides, the focus of image capturing was conducted in relevant regions of interest.

Conclusion
A deployment model was also performed using Android smartphone technology to enable rapid decision-making through integrating the Tensorflow framework, Keras and Android Studio Version 3.6.2. Tensorflow lite model was automatically developed for in-field classification hybrid maize parental lines. However, this study revealed that the prediction accuracy can be improved by fine-tuning the image datasets in the relevant regions of interest. The integration of the model with Andriod smartphone technology enables rapid and real-time recognizing of off-type plant during the roguing process in hybrid maize seeds production. The advantage of this model is to enable personnel with limited skills or knowledge on maize parental lines ideotype during breeding or seed production to appropriately select the desired trait. Furthermore, the authors recommend the use of modern phenotyping system to support the decision-making process in large-scale hybrid maize seed production activities worldwide particularly in Indonesia.