Evaluation of Beef Marbling Grade Based on Advanced Watershed Algorithm and Neural Network

: As to the problem of inaccurate in traditional grade method of beef marbling, a automatic grading system based on computer vision had been founded and was used to predict the beef quality grade of Chinese yellow cattle. Image processing was used to automatically evaluate the beef marbling grade. Segmentation methods used in rib-eye image of beef carcass was improved watershed algorithm. All grading indicators were obtained by image processing automatically. Four grading indicators, which characterize the size, number and distribution of marbling particles, were proposed for the inputs of neural network prediction model. The experimental results indicated that the image processing methods were effective. The grading system based on computer vision and neural network model can better predict the beef quality grading. The prediction accuracy of beef marbling grade was 86.84%. Algorithm proposed in this study proved the image processing and neural network modeling is an effective method for beef marbling grading.


INTRODUCTION
Institution of beef grading standard may depends on quality grade and yield grade of beef carcass in many countries.Objectivity, accuracy, practicality, scientificalness of beef grading standard and grading method will have a direct impact on development of beef industry.Beef quality grade and yield grade were generally included in beef carcass quality grade.In china, the grading of beef marbling is performed by visual inspection of beef carcasses at the 12 th -13 th ribeye section by graders and there is no quantitative methods and standards for quality grading.Subjective experience of different graders may affect the consistency of result.Image processing technology enables the use of computer vision to replace manual method and it will improve the work efficiency, accuracy and reduce operating cost.
There was no a suitable segmentation algorithm that is for every rib-eye image.Most of algorithms require suitable lighting conditions for image acquisition.And the background color of image should be contrast to the color of muscle and fat.The sample needs to be removed from the production line.This system needs on-line image acquisition and processing and the beef sample needn't to be removed from the production line.As to the problem, this study proposed a fast and accurate algorithm that is less sensitive to illumination and suitable for image with the complex background.The goal of this study is to set up the grading system for beef marbling combined with the beef marbling extraction by image processing, automatic grading and the result output model.

Sample preparation:
Beef marbling image of Chinese yellow cattle was studied in HaoYue group, Changchun, Jilin province.The beef carcass should be washed, slaughtered, centrally-split into two sides by Fig. 1: Synchro-control circuit professional butcher and then chilled for 24 h postmortem at 0~4°C before our experiment.Cut beef carcass cross-section between the 12 th and 13 th ribs was selected for image acquisition.And the standardized beef marbling images, which have 4 classes, would be against the image captured.
The acquisition process was carried out on the production line.The distance from the camera lens to the sample surface was about 40 cm when the rib-eye image was captured.The hardware for machine vision system consists of CCD camera, photoelectric switch, light source, data acquisition board and computer.The lighting can affect greatly the quality of image.Because the image of bad quality may increase the processing time and complexity of the subsequent image processing (Du and Sun, 2004).The choice of light source of this system should meet the requirements was the lighting brightness, uniformity and the spectral characteristics of light.In this study we chose photoflash because of it's concentration of light energy, high brightness and uniformity of illumination.A synchro-control circuit (Fig. 1) was needed to control the photoflash and camera simultaneously working.When the sample passed through the photoelectric switch, an electric level transition was produced by photoelectric switch and was received by camera and computer.

Evaluation of beef carcass quality grade:
The beef quality grade is determined by beef marbling grade, an image processing method was proposed for automatic grading by computer.

Object region extraction by image processing:
The beef marbling grade was determined by graders in most beef manufacturers.In this study, we used computer vision technology in place of traditional artificial method.Marker-controlled watershed segmentation algorithm was used to extract rib-eye region from image.The procedure of segmentation was described as the following steps: Image preprocessing: Watershed algorithm is sensitive to the image brightness level and color.So in order to reduce the computational complexity of subsequent work, a threshold segmentation operation was carried out in HSV color space before watershed segmentation.
HSV (Hue, Saturation, Value) color representation is consistent to perception of human.S (Saturation, as in Eq. ( 1)) channel shows the image color saturation, while the V (Value, as in Eq. ( 2)) components represents the different shades of color.New parameter (I) obtained by logical operation with S and V was proposed in Eq. ( 3).Experiment showed that this new parameter would maintain relatively stable when light changes, which may reduce the impact on image quality from light conditions and illumination angle.The transformations of RGB color space to HSV color space were as following: A new parameter calculated by S and V was proposed as following: In image composed of parameter I, the contrast of target and background increased.The region with lighter color around the rib-eye and the non-flat crosssection were accordingly removed or weaken and the rib-eye region was "isolated".Then threshold segmentation was operated to roughly separate the ribeye region from around.

Rib-eye region segmentation:
Before the extraction of beef marbling, the rib-eye region should be extracted accurately.Marker-controlled watershed segmentation algorithm was selected for region segmentation.The classical edge detection operator is sensitive to the noise when detecting the edge of goal.So we chose mathematical morphology operator to compute the gradient magnitude.
The gradient magnitude was calculated as following: where, The gradient magnitude was chose as segmentation function.To avoid the over-segmentation, foreground objects and background objects of image should be labeled before watershed segmentation.Morphological techniques called "opening-by-reconstruction" and "closing-by-reconstruction" were used to mark the foreground objects and background objects.
Set up the original image (f) as a mask, g as the marker: where, let h 1 = f, then iterative operation of opening-byreconstruction is defined as following: where, R O is opening-by-reconstruction image and iteration stops when h k +1 = h k , let j 1 = R O , then iterative operation of closing-by-reconstruction is defined as following: where, R C is closed reconstructed image and iteration stops when j k +1 = j k .
After segmentation, the rib-eye area, beef marbling area, number of marbling particles and area of single marbling particle were obtained by 4-connected component labeling algorithm.

Evaluation of segmentation accuracy:
Target segmentation accuracy of object region depends on the quality of segmentation.The actual object region was extracted by manual method.The object region was erased out by graphics processing software and then the number of pixels in foreground and background were obtained.The region would be compared to the segmented region by image processing for accuracy evaluation.We have chosen the Ultimate Measurement Accuracy (UMA) and Misclassified Error (ME) (Zhang and Gergrands, 1992;Lee et al., 1990) for evaluation of rib-eye region segmentation.And ultimate measurement accuracy was used to evaluate the segmentation result of beef marbling:

Calculation of grading characteristic parameters:
Selection of characteristic parameters for grading is very important.Accuracy of final grading would be affected by them.Kuchida et al. (1992) proposed the feature quantities include the fat ratio, the circumference of the different fat regions, the number of fat particles.Jinglu (2004) divided the marbling particles into three categories according to size and used four parameters to characterize the marbling abundance, they were the number of particles in each category per unit rib-eye area, area of particles in each category per unit rib-eye area, count of all marbling particles per unit rib-eye area and total marbling area per unit rib-eye area, respectively.Jeyamkondan et al. (2000) selected the area, perimeter of marbling particle in beef carcass rib-eye and the number of marbling particles as characteristic parameters to determine beef marbling grade.The result of multiple regression by characteristic parameters and the result of beef quality evaluation from professional grader was equivalent.Jackman et al. (2008) used statistical methods to describe the characteristics of marbling particles and proposed five marbling characteristics to describe the marbling grade with mean, standard deviation, skewness, kurtosis and interquartile range.Kazuhiko et al. (2000a) proposed some points that should be primarily examined while classification process of beef marbling: the ratio of marbling in rib-eye region; the number and size of the marbling particles; distribution of the marbling.He proposed five grading indicators for marbling grade, they are the percentage of marbling in rib-eye region, the number of marbling, the number of large marbling, the number of small marbling and the amount of scatter of the distribution of marbling in rib-eye region.So the element that affects the marbling grade is not only the number of marbling particles, but also the uniformity of marbling distribution.Based on above requirements, this study selected four grading indicators, they are marbling area density (S d ), number of marbling particles (N), particle distribution coefficient (CV r ), particle size uniformity (CV s ), respectively.

Marbling area density (S d ):
Ratio of marbling in ribeye region may represent the content of intramuscular fat and also as an important indicator to determine the marbling grade.But only using marbling area density to evaluate the grade is not reliable and comprehensive.

Particle distribution coefficient (CV r ) :
The distribution of marbling affected the marbling grade greatly.Usually, the more marbling particles in rib-eye region, while the distribution of marbling is even, the higher the grade of marbling; on the other hand, if number of marbling is small, while the distribution is uneven, so the level of marbling is low.However, if the number of marbling is big, but unevenly distributed in the rib-eye region, then the grade of marbling should be a corresponding reduction (14).Distribution of all marbling particles cannot be characterized by distribution of marbling particles in local, so we chose CV r to express the distribution of marbling particles in entire rib-eye region.In Fig. 2a and b, the quality of sample a is better than sample b.CV r can fully reflects the marbling distribution in rib-eye region.
Marbling size uniformity (CV s ): Beef marbling of different breeds is different not only in shape, but in size.Therefore, the size of large and small particles is difficult to define.This study chose the marbling size uniformity as the evaluation indicator.Even though distribution of marbling is uniform, but if the difference among the marbling particles is big, it will definitely affect the meat appearance and texture, as shown in Fig. 2c and d.Although, the marbling area density of two samples are same, but the quality grade of two samples are different.Discrete coefficient of area density of each marbling particle was selected for size uniformity.
In fact, marbling grade was often characterized by multiple indicators.S d , CV r , CV s and N may reflect different aspects of quantity and distribution of intramuscular fat and were selected for inputs of prediction model.
Each marbling particle region was labeled by region labeling.Then characteristic indicators were calculated according to Eq. ( 10) to (13):  As seen in Fig. 5 and 6, the results showed that the ultimate measurement accuracy of rib-eye region area and perimeter were 96.98±1.76%and 92.67±6.72%,respectively.The misclassified error of rib-eye region was 9.44±3.54%.The ultimate measurement accuracy of area and number of beef marbling were 93.41±4.44%and 91.27±5.55%.The results proved that the improved watershed segmentation algorithm was efficient, accurate and reliable.
Back propagation neural network analysis was performed with MATLAB program.The input layer, hidden layer and output layer were four, fifteen and one neurons, respectively.S d , N, CV r and CV s were multiple inputs and beef marbling grade was output.The actual marbling grade was given by an experienced grader.The training conditions of the network are that, the number of epochs is 100, error was 0.001 and the learning method is Quasi Newton Method.The input data should be normalized before using it for training.Total number of inputs to the network was 72 and the number of test samples was 40.The samples were divided into four subsets for testing.All subsets had same number of samples in each beef marbling grade.The accuracy of prediction model for marbling grade was 86.84% and the average deviation was 2.35.
In this study, a segmentation method based on improved marker-watershed algorithm was used for extraction of rib-eye region and beef marbling particles.The results show that the algorithm proved high segmentation accuracy and there was no excessive demand on background.The entire segmentation process didn't need the regional consolidation after the segmentation and reduced the complexity of segmentation.This study proposed 4 indicators for grading of beef marbling and set up the prediction model by neural network.All prediction indicators were obtained by image computation and the results proved to be efficient.
Automatic evaluation of beef quality by machine vision proved to be efficient, fast and accurate.The result of this research proved segmentation algorithm of improved watershed method is worthy of developing.The grading system based on machine vision can be used in laboratory and production enterprise in the future.
where, R f = The characteristic value obtained from the origin rib-eye region S f = The characteristic value measured from the segmented rib-eye region: B T = Background of origin image and segmented image I O , I T = Object region of origin image and segmented image

Fig. 2 :
Fig. 2: Schematic of parameters represented the image information Number of marbling particles (N): Number of marbling particles is usually associated positively correlated with grade.To a certain extent, it also reflects the distribution of intramuscular fat characteristics of muscle quality.