Using Deep Learning Neural Network in Artificial Intelligence Technology to Classify Beef Cuts

The objective of this research was to evaluate the deep learning neural network in artificial intelligence (AI) technologies to rapidly classify seven different beef cuts (bone in rib eye steak, boneless rib eye steak, chuck steak, flank steak, New York strip, short rib, and tenderloin). Color images of beef samples were acquired from a laboratory-based computer vision system and collected from the Internet (Google Images) platforms. A total of 1,113 beef cut images were used as training, validation, and testing data subsets for this project. The model developed from the deep learning neural network algorithm was able to classify certain beef cuts (flank steak and tenderloin) up to 100% accuracy. Two pretrained convolution neutral network (CNN) models Visual Geometry Group (VGG16) and Inception ResNet V2 were used to train, validate, and test these models in classifying beef cut images. An image augmentation technique was incorporated in the convolution neutral network models for avoiding the overfitting problems, which demonstrated an improvement in the performance of the image classifier model. The VGG16 model outperformed the Inception ResNet V2 model. The VGG16 model coupled with data augmentation technique was able to achieve the highest accuracy of 98.6% on 116 test images, whereas Inception ResNet V2 accomplished a maximum accuracy of 95.7% on the same test images. Based on the performance metrics of both models, deep learning technology evidently showed a promising effort for beef cuts recognition in the meat science industry.


INTRODUCTION
Modern consumers are becoming more interested about the production story for the foods they select and put on their dinner plate. Information regarding the source of the food, nutrition, and product quality has become an important purchase decision factor as household incomes increase. For example, beef quality has been an important factor evidenced by consumers' willingness to pay a premium for tender steaks (Lusk et al., 2001;Kukowski et al., 2005). Other studies have shown that nutrient and meat quality profiles are related to muscle fiber composition and the proximate composition of meat cuts (Jung et al., 2015;Jung et al., 2016).
Efforts have been made to profile individual beef muscles' nutrition and palatability characteristics (Jeremiah et al., 2003). Providing profile characteristics for different meat cuts allows the consumer to make a more informed purchase decision. Seggern and Gwartney (2005) identified muscles in the chuck and round that had the potential to be a value-added cut. Several new beef cuts were identified, including the flat iron, chuck eye steak, and Denver cut. The success of these innovative retail sub-primal cuts resulted in increased revenue for the beef industry by adding value to previously underutilized cuts of meat that often ended up as trim for ground beef. Cuts such as the flat iron steak became more and more popular, and it became increasingly apparent that consumers were not familiar with the new names and had difficulty identifying them in the retail case. Consumers can educate themselves regarding the different beef cuts by using charts produced by the U.S. Cattlemen's Beef Board and National Cattlemen's Beef Association that are available online or at the point of purchase. However, modern consumers use information from multiple sources regarding nutrition information for their healthy cooking methods and to identify the correct cuts that match the nutrition and palatability expectations. Obtaining accurate information is often time-consuming, and consumers are often directed to wrong information due to the lack of available information on beef cuts. Therefore, a fast, accurate objective technology is needed to recognize beef cuts information, so the consumers can obtain useful nutrition information for their health. In addition, the meatpacking industry can use this kind of novel technology to put correct cuts/nutrition information on the meat package.
Artificial intelligence (AI) has been used to recognize different targets such as text/words, expression of disease, food identification, and identity authentication system (Curtis, 1987;Anwar and Ahmad, 2016;Bai, 2017;Buss, 2018;Liu et al., 2018;Jia et al., 2019;Islam et al., 2019). Known for being efficient, accurate, consistent, and cost-effective, AI suits the meat industry's rapid mass production (Liu et al., 2017). Recent studies showed that AI technology has great potential to detect marbling in beef and pork (Chmiel et al., 2012;Liu et al., 2018), fresh color of pork , tenderness of beef (Sun et al., 2012), and grading of beef fat color (Chen et al., 2010). Moreover, Schmidhuber (2014) provided an overview of many deep learning neural networks used for pattern recognition relevant for several domains such as facial recognition (Russakovsky et al., 2014), disaster recognition (Liu and Wu, 2016), and voice recognition You et al., 2018). Moreover, deep learning has been applied to sheep breeding classification (Abu et al., 2019), food classification (Hnoohom and Yuenyong, 2018), bacon classification (Xiao et al., 2019), classification of species in meat (Al-Sarayreh et al., 2020), and the farming and food industries. The CNN is a popular deep learning tool, which has been used widely in classification problems. The most significant advantage of CNN is its automatic learning ability from an input image without feature extraction (Hinton et al., 2006), but CNN requires a larger image data set to train the model from the scratch (Krizhevsky et al., 2017). To overcome this situation, the transfer learning technique has been used in which a pretrained model is used in a new problem. Both VGG16 and Inception Res Network are the two popular CNN architecture models, which use the transfer learning approach to solve the image classification problems.
The ImageNet competition winner VGG16 model is also a CNN proposed by K. Simonyan and A. Zisserman from the University of Oxford in the article "Very Deep Convolutional Networks for Large Scale Image Recognition." It makes an improvement over AlexNet by replacing 5 × 5 kernel size by 3 × 3 kernel-sized filters one after one. Practically, a stack of 5 × 5 kernel is related to two 3 × 3 kernels, and a 7 × 7 kernel is equivalent to three 3 × 3 kernels. In short, VGG16's nonlinear transformation increases the ability of a CNN to learn features in a better way. In the convolutional structure of VGGNet, a (1 × 1) convolutional kernel is used, and without affecting the input and output dimensions, nonlinear transformation is introduced to increase the efficiency of a network and reduce calculations. During the training process, training is performed at the lowlevel layers, and then the weights of ImageNet are used to initialize the complex models that follow in order to speed up the convergence of training.
Another CNN-based model is the inception network, which is widely used in the field of artificial intelligence (Deng et al., 2010;Too et al., 2019). CNN classifiers perform better with a deep layer but face issues with overfitting, smaller kernel, and vanishing gradient. Inception networks reduce these problems with multiple filter sizes in the same level that is addressed as "wider," rather than "deeper" in the case of neural network architecture. It performs convolution of an input with multiple different size filters such as 1 × 1, 3 × 3, and 5 × 5 (Szegedy et al., 2017). Inception Resnet V2 modifies the Inception network and reduces the computational cost with hyperparameter tuning of three major blocks.
To avoid the overfitting problem in limited image data sets, image augmentation technique could be applied to the image data set before feeding the image into the Inception Network and VGG16 architecture (Olsen et al., 2019).The image augmentation technique is widely used to expand or enlarge existing image data sets artificially using different processing methods. To build a robust image classifier using very little training data, image augmentation is required to boost the performance of neural networks (Ahsan et al., 2019). Widely used augmentations are random rotation, shifts, shear, flips, zooming, filtering etc. Random rotation replicates the original image by rotation in between 0 and 360°. Horizontal and vertical shift move the pixels of original images by Frontiers in Sensors | www.frontiersin.org June 2021 | Volume 2 | Article 654357 2 2-dimensional direction. Flipping indicates reversing image data by row and columns. Zooming randomly zooms different parts of the input image. Different types of filtering help generate images from low light to brighter, low contrast to high contrast, and various saturation levels (Shijie et al., 2017). We can also use different types of domain-specific functional processing and create augmented images to better perform image classifiers. Image augmentation is highly recommended for object detection, but the right processing choice is important for a robust model with a limited number of training input. An inappropriate selection of an augmentation technique can have a detrimental effect on the classifier. Multiple image augmentation techniques are preinstalled in the TensorFlow library (TensorFlow, nd) and there are functionalities to add user-defined techniques (Sokolova and Lapalme, 2009).
In 2016, the Google TM Brain team released a new deep learning neural network open-source software package called TensorFlow (Abadi et al., 2016). This free, open-source deep learning algorithm library provides an effective, fast, and accurate source of artificial intelligence for industry applications (Zhang and Kagen, 2017;Han et al., 2018;Chen and Gong, 2019;Qin et al., 2019;Suen et al., 2019;Vázquez-Canteli et al., 2019). Furthermore, the TensorFlow backend model could be deployed to the mobile application and IoT devices using TensorFlow Lite (tflite) (Google Inc., nd), which is lean and fast to get real-time results. Some literature has used the tflite model file in a mobile application in their research (Tarale and Desai 2020;Pandya et al., 2020). The CNN deep learning technologies using TesnorFlow has not yet been applied for the classification of meat cuts.
The objective of this study was to develop a beef cut classification system based on off-the-shelf TensorFlow deep learning neural network coupled with the image augmentation technique, to measure prediction performance with images acquired in varying lighting and background conditions and processing levels, and to provide fast, accurate beef cuts information to the consumers and meat industry.

Beef Cuts Image Collection and Acquisition
A total of seven different types of retail beef cuts ( Figure 1) were used in the experiment, including rib steak, bone-in (IMPS 1103); rib eye steak, lip-On, boneless (IMPS 1112A); chuck eye roll steak (IMPS 1116D); flank steak (IMPS 193); strip loin steak, boneless (IMPS 1180); short ribs, bone-in (IMPS 1123); and tenderloin steak, center-cut, skinned (IMPS 1190B). All images used for training and testing the TensorFlow deep learning neural network were either obtained from available online image libraries, except for the boneless rib eye steaks, which were obtained from our existing image library ( Table 1). Images for all seven beef cuts were obtained from various online and laboratory pictures with different backgrounds to simulate different environments that consumers would face to recognize the different beef cuts (Figure 1). A total of 1113 image sets were randomly divided into training (80%), testing (10%), and validation (10%) data subsets. We strongly believe that a pretrained model with an unknown data set will produce a close and convincing result. One of the major practicalities of using transfer learning is using a pretrained model's weights, which carries out information on millions of images from ImageNet (Russakovsky et al., 2014). This process not only consumes less time to train, validation, and testing the model but also improves the overall prediction and classification accuracy (Yim et al., 2017).

Incorporation of Image Augmentation to VGG16 and Inception ResNet V2 Architecture to Classify the Beef Cuts
An existing neural network model to perform a similar sorting task was used for the initial beef cut classification ( Figure 2). By using the lower layer of an already trained neural network for the image classification (commonly referred to as "transfer learning") (Chang et al., 2017;Rawat and Wang 2017), the training of the new network became considerably faster and required fewer images. A previous study demonstrated that transfer learning combined with the image augmentation technique has increased the classification accuracy (Ahsan et al., 2019;Shorten and Khoshgoftaar, 2019). Therefore, the image augmentation technique has been applied to develop a VGG16 and Inception ResNet V2 model in beef cuts image data sets ( Figure 3). VGG16 ( Figure 4) and Inception ResNet V2 ( Figure 5) architecture were used to develop a meat classification model due to their strong performance on highly variable data sets and their availability or sources on Keras (an open-source software library for the artificial neural network) and TensorFlow backend. Besides this, it is easy to convert the model developed by this technique into the TensorFlow Lite (tflite) for the developing meat cut classification system. TensorFlow, Keras application program interface (API), and python libraries were used for image augmentation, VGG16 and Inception Resnet V2 model training, and testing and validation. Before initiating the training step of the Inception ResNet V2 and VGG16, the image augmentation technique was applied in input data set using Keras ImageDataGenerator API, which helps boost the model performance. ImageDatagenerator API generates more images in the data sets after the application of rescale, shear, shift, vertical flip, rotation, zoom, and horizontal flip. For this, rescale, shear_range, height_shift_range, vertical_flip, rotation_range, width_shift_range, zoom_range, and horizontal_flip values were set to 1./255,0.2,0.1, True, 20,0.1,0.2, and True, respectively, for training data generation, whereas only the rescale value was set to 1./255 for validation image generation.
After image augmentation, the VGG16 model and Inception ResNet V2 model were developed to detect seven types of beef cuts. The last three fully connected layers (Figure 4) were followed by a softmax function (function which squashed the final layer's activations/logits into the range [0, 1] layers) to predict the multiclass labels (Simonyan and Zisserman 2014;Ahsan et al., 2019). Every convolutional layer in the VGG16 followed by a Relu (rectified linear unit), which is one of the most widely used functions in neural networks to join Conv layers. It rescales the negative numbers from zero to the maximum positive number. Normalization was not used since it was not affecting the accuracy significantly. The input image started with 224 × 224 as the output of image augmentation and then converted into three channels of RGB images, which were then processed into two hidden layers of 64 weights. Later, maxpooling reduced the sample size from 256 to 112, and again, this process was followed by another two convolutional layers with weights of 128. These weights kept increasing until they reached 512. Each convolutional layer is followed by maxpooling layers. At the end of the network, categorical cross-entropy with a softmax function, also called as softmax loss, was used. The adaptive moment estimation (Adam) optimizer was used to adjust the weights and reduce the overfitting. The Adam optimizer is one of the fastest stochastic gradient descent optimizers which calculate every parameter's learning rate first and then change and store the momentum changes (Li et al., 2004;Zhang et al., 2018;Ahsan and Nygard, 2020). Similarly, the inception ResNet V2 model was developed without the application of normalization. Furthermore, the Adam optimizer was used to compare the performance with VGG16.

Mobile-Based Deep Learning Classification System Using TensorFlow Lite Model
Beef cuts data set was divided into the training, validation, and testing data subsets in order to build and evaluate a supervised deep learning model. Among these steps, the validation is the most important component of building a supervised model (Xu and Goodacre, 2018) because a model's performance is primarily judged based on validation data sets. In this classification model, an input data set was provided with names of the steak as desired output corresponding to a particular steak image as input data. For training the model, seven categories of steak images with proper labels were used. The training process was performed on 50 epochs with 32 steps per epoch for both models, which produced a model with low error and high accuracy. We set the batch size to 27 after multiple trials and errors, and total epochs per batch were set to 32 for both models. The initial learning rate was finetuned and adjusted based on the feedback of training accuracy during a learning event (Fan et al., 2019). The validation batch size was set to 10 for both approaches. Table 2 shows the steak type with their corresponding number of images used in training, validation, and testing with percentage of accuracy for the VGG16 and Inception ResNet V2 model. The training, testing, and validation were performed on a local machine (HP Omen 15t Laptop) with specification of 32 gigabytes of randomaccess memory (RAM), Core i9-9880H processor, and a GeForce RTX-2080 8 GB GPU consisting of 2,944 compute unified device architecture (CUDA) cores. The Google Cloud Platform (GCP) was used to validate these experiments using a similar setup and data set. The Tesla p100 16 GB GPU of GCP produced very close results, with a standard deviation of 0.001, which is negligible for reproducibility of the machine learning models (Learning and Zheng, 2015).
In order to makes the model faster, the VGG16 and Inception ResNet V2 models in the Keras H5 format were converted into a TensorFlow Lite (tflite extension file). This format saves and preserves network architecture and configuration (which specifies what layers the model contains and how they are connected), a set of weights values, an optimizer, and a set of losses and metrics. To convert an H5 file format into the tflite format, TensorFlow TFLiteConverter API was used. Finally, the tflite model obtained was deployed on a mobile application, which was developed using a cross-platform framework called React Native.

RESULTS
In this research, the selected VGG16 model with data augmentation technique combination was able to achieve the highest accuracy of 98.57% on 116 test images. However, the training accuracy reached 100% during experiments using 887 training and 110 validation images. The training process was performed on 50 epochs, and the loss factor was optimized by the Adam optimizer effectively from the first epoch. Since we set steps per epochs as 32, the training process helped to reach the global    Frontiers in Sensors | www.frontiersin.org June 2021 | Volume 2 | Article 654357 6 minima after 10 epochs. Based on the decrement of categorical cross-entropy the prediction from the softmax function was aligned with an actual class label. Figure 6 shows that the VGG16 training loss reached the lowest point during epoch 47 and the validation loss was lowest during epoch 45. Though the accuracy is the most intuitive performance measurement to observe the model's prediction ratio, the precision score is better to indicate the model's robustness (Denton et al., 2016;Ahsan et al., 2018;Gomes et al., 2018). High precision indicates the model has low false-positive rates. From Figure 7, we can observe that the false-positive rates of the VGG16 are very low on average. Table 3 shows that sensitivity (recall) is relatively higher than the standard 50%. Also, the F1 score consistently follows the accuracy and precision and was always more than 94%.
The Inception ResNet V2 was also implemented with the same parameter setup as the VGG16 on a similar data set. The early epochs showed promising results, but on average, the model did not perform better than VGG16. The accuracy and loss graph of Inception ResNet V2 (Figure 7) showed inconsistency at different stages during the training process. Also, the false-positive rates and F1 score indicate that it failed to accurately predict all the Flank steak, New York strip, and tenderloin classes' images. The primary assumption is that since the kernel size of Inception ResNet V2 is larger than that of VGG16, it failed to localize some inputs in detail information. The highest accuracy of Inception ResNet V2 on the testing data set was documented as 95.71% (Figure 8), significantly or slightly lower than VGG16 accuracy (98.57%) for the same data set. The detailed comparison of both models' key performance indicators (KPI) can be observed in Table 3.
The TensorFlow deep learning neural network showed a great potential in recognizing and classifying beef cuts with reasonably good accuracy. Accuracy is the most intuitive performance measure and a simple way to observe the prediction ratio but often misleading when the data set has not symmetric falsenegatives and false-positives (Powers, 2011). To further investigate our VGG16 model, we measured the ratio of correctly predicted positive observations as the precision score. High precision indicates low false-positive rates which is observed on the accuracy metrics graph (Figure 9). The graphs also showed that the recall (sensitivity) is always above the standard value of 0.5 . Since our class distribution is uneven, the F1 score is a useful metric to measure performance. Except the boneless rib eye steak, every class has a very good weighted average of precision and recall, which infers that our model is practical and reusable.

DISCUSSION
Artificial intelligence (AI) utilizing the deep learning algorithm has potential to accurately classify different retail cuts of beef. Previously, researchers have successfully classified meat adulteration with better accuracy using support vector machine (SVM) and CNN from hyperspectral images (HSI) (Al-Sarayreh et al., 2018). The feature extraction technique and model complexity were adequate for only HSI. However, these technologies were not applicable for compressed images such as images from the cellular phone, digital camera, and Internet as input. Object detection is also applied for meat cut traceability using radio frequency identification (RFID) and physical tagging which seem promising for block chain technology (Larsen et al., 2014). Other than computer vision algorithms, different machine learning techniques are used by researchers to classify meat cut, which includes extensive feature extraction process and often hard to generalize. Some research has used a lot of noninvasive in vivo data which are collected from different categories to predict the meat cuts using the artificial neural network (ANN) and multiple linear regression (MLR) (Alves et al., 2019). The ANN is proven useful for lean tissue detection in the early research application of AI in meat cut using a hybrid image segmentation technique to produce RMSE as low as 0.044 (Hwang et al., 1997). These results are still not reusable as the sample size is only 40, which is very low for a neural network to be trained.
The beef cuts image classification system in this study was inspired by the convolutional neural network architecture based on the transfer learning approach (Abu et al., 2019;Ahsan et al., 2019). An end-to-end open-source machine learning platform developed by the Google research team called TensorFlow was used in this study. The TensorFlow deep learning library has many advantages in that it is an open-source system that is easily access to the public. Therefore, the present study results can be incorporated into the open-source repository and made available to everyone interested in classifying beef cuts. A free-access and off-theshelf deep learning neural network with AI technology was improved by the incorporating image augmentation technique and evaluated to classify seven different types of beef cut images quickly. Both VGG16 and Inception Resnet V2 architecture coupled with image augmentation techniques, namely, rotation, flip, and shift using TensorFlow and Keras libraries were able to successfully identify and classify the beef cut correctly over 96% of the time. This study demonstrated that higher classification accuracy can be achieved using the pretrained CNN model coupled with the image augmentation technique in beef cuts classification. VGG16 (98.6%) outperformed the Inception ResNet V2 (95.7%) model in terms of classification accuracy.
This research is the harbinger of an efficient AI-based meat cut system, which is merely depicted as a prototype model. Higher classification accuracy and easy deployment of the AI model in the backend application program interface (API) for any type of application (web or mobile) have proven the significance of AI in meat classification. The deep learning model developed in this research has shown the potential to be used in a phone application to provide consumers a real-time beef cut recognition tool in meat industries. Therefore, the model developed for beef cuts classification was converted into a tflite format and deployed in a mobile application. Later, some of the random images from Google were tested in mobile application. Figure 10 shows the beef cuts classification part on a mobile application. Based on the type of the beef cuts recipe information, the mobile application provides the recipe information for the consumer. Statista (2016) noted that by 2020, the number of FIGURE 9 | Inception ResNet V2 accuracy, F-1 score, precision, recall, and false positive measures on test data.
Frontiers in Sensors | www.frontiersin.org June 2021 | Volume 2 | Article 654357 9 global smart phone users will reach to 2.87 billion. Thus, anyone with a smartphone with Internet access will have access to this beef cut classification tool through a phone application platform. The seven beef cuts selected for this research were identified as the most popular beef cuts sold at local retail markets. Future classification training could be added to the model that includes additional beef retail cuts like those available in print or online from the beef cuts guide maintained by the National Cattlemen's Beef Association (National Cattlemen's Beef Association 2012).

DATA AVAILABILITY STATEMENT
The raw data supporting the conclusion of this article will be made available by the authors, without undue reservation.

AUTHOR CONTRIBUTIONS
SG: main writer and original draft preparation; BS: review and editing; YZ: AI algorithm supervising and editing; DR: meat sample preparing and analysis; MA: AI algorithm testing and data analysis; EB: funding acquisition and editing; XS: project PI and editing.

FUNDING
This study was funded by the North Dakota Beef Commission (project number FAR0027501) and North Dakota State Board of Agricultural Research and Education (project number FARG090370).