| Eggs are our daily essential food on the table.Eggs are abundant in nutrition and cheap in price,and they are very popular among the public.At present,due to technical reasons,egg grading in my country is still at the level of manual operation,and the overall efficiency is low.Although our country already has a corresponding grading standard for poultry eggs,due to the lack of advanced and fast grading technology in the actual operation process,manual sorting takes a long time and the progress is slow.This article uses machine vision technology to classify the size and color of eggs.The purpose is to use machine vision technology to replace manual operations to achieve automatic grading and sorting of eggs and improve work efficiency.Due to the differences in the growth environment of laying hens in different regions,the nutritional value of free-range eggs is also very different.It is difficult to identify the place of origin through the egg shell.This paper combines the near-infrared spectroscopy technology to analyze the four regions of Shanxi Province(Shuozhou,Luliang,and Lvliang).Jinzhong,Yuncheng)has conducted a traceability study on the origin of free-range eggs,which is of great help to standardize the market of my country’s egg industry and improve the level of intelligence in the poultry industry.Machine vision technology is used to realize the grading of egg size and the identification of eggshells of different colors,and the use of near-infrared spectroscopy technology to realize the traceability of different origins of eggs.The main research contents and conclusions are as follows:(1)Build an information collection system.During the experiment of egg size and color grading,build an image acquisition system by yourself according to the designed experimental plan.In order to obtain accurate image information of eggs,the various parameters of the image acquisition system were determined through preliminary experimental research to ensure the uniform illumination of the entire lighting system and minimize the surrounding noise interference.Mainly include,lighting system,dark box,egg tray,image acquisition device.In the research on the traceability of egg origin using near-infrared spectroscopy technology,a near-infrared spectroscopy data acquisition system was designed and built,which mainly includes near-infrared spectrometer,signal acquisition fiber,dark box,egg tray,lighting source and computer transmission system(2)Egg image preprocessing.Use image binarization,image grayscale,and histogram equalization to complete the preprocessing of the original image of the egg.Its purpose is to remove the noise and other interference caused by the image acquisition process.Use image binarization to greatly compress the useless information in the image,turn it into black and white,and highlight its important contour parts;The gray-scale processing of the image is to reduce the inconvenience of color information for subsequent research.Because this experiment is carried out in a dark box,the maximum value method in the gray-scale processing is adopted according to its characteristics to make the gray-scale image brighter;The purpose of using histogram equalization is to reduce the gray level of the image and improve the contrast.(3)Establish an egg size grading model.The regression model is established by measuring the actual egg quality and the number of pixels in the image after preprocessing,and the relationship between the quality and the number of pixels is obtained.There is an obvious correlation between the two,and the coefficient of determination R2 of the model is obtained as 0.9864.On this basis,another 60 egg samples were taken as the reference.The relative error between the quality estimated by machine vision and the actual quality was 5.68%,the minimum was 0.26%,the average relative error was 2.36%,and the prediction accuracy reached 93.33%.A support vector machine(SVM)was used to establish a grading model of egg quality,and a functional relationship between the image characteristics and the quality of the eggs was established according to the expectations,and they were divided into three categories.The results show that the prediction accuracy of the three types of samples is 83.33%.Through comparison,it is found that the effect of choosing a model between the number and quality of pixels will be better.(4)Extraction of egg color features.The preprocessing of the image information of the egg sample mainly includes methods such as image binarization,grayscale,and denoising.Extract the three color component eigenvalues(R,G,B mean and R,G,B variance)of three different color egg samples of white,pink,and green shell respectively in the RGB image system,a total of 6 color feature parameters,And use it as a quantitative description parameter of egg color.(5)Establish a color classification and recognition model.A BP neural network and an extreme learning machine model were established,and the 6 color features extracted as parameters were used to automatically classify the different colors of eggs.The results show that,based on the BP neural network classification model,three different colors of eggs get a good classification effect,and the prediction accuracy of white eggs is 100.00%;The prediction accuracy rate of powder-shell eggs is 100.00%;The training accuracy rate of green shell eggs is 93.33%,and the comprehensive prediction accuracy rate of the three types of eggs is 97.78%.Based on the extreme learning machine(ELM)classification model,the prediction accuracy rate of white eggs is 93.33%;The prediction accuracy rate of powder-shell eggs is 100.00%;The prediction accuracy rate of green-shell eggs is93.33%,and the comprehensive prediction accuracy rate of the three types of eggs is 95.56%.Through comparison,it is found that the model of BP neural network is better for egg color classification.(6)Feature extraction of egg regions.The effects of MSC,SG(3 points),SNV,SNV+MSC,SG(3 points)+ SNV,SG(3 points)+ MSC,etc.on the establishment of the model are compared,and SG(3 points)is determined as The best pretreatment method,based on which the principal component analysis model is established.The results show that the use of principal component analysis can fully express the overall distribution of samples in 4 regions.Among them,Taigu and Lvliang regions can be clearly separated from other regions,while Yuncheng and Shuozhou regions have a few overlaps.(7)Recognition model of egg origin.SIMCA and PLS-DA were used to establish the traceability model of different origins of eggs.The results show that the use of PLS-DA modeling can better separate the eggs in the 4 regions,and the recognition rates are 68.0%(Shuozhou);74.6%(Lüliang);72.0%(Taigu);80.55%(Yuncheng).The recognition accuracy of the SIMCA modeling prediction set reached 100%.Among the recognition rates,only Shuozhou’s accuracy rate was95.8%,and the rest reached 100%.In the prediction set,the recognition rate of the four regions all reached 100%,the rejection rate of Luliang and Yuncheng regions reached 100%,and the rejection rate of Shuozhou and Taigu regions reached 98.6%. |