TWI708194B - Method for real-time estimation of coffee bean agtron baking level - Google Patents

Method for real-time estimation of coffee bean agtron baking level Download PDF

Info

Publication number
TWI708194B
TWI708194B TW108101000A TW108101000A TWI708194B TW I708194 B TWI708194 B TW I708194B TW 108101000 A TW108101000 A TW 108101000A TW 108101000 A TW108101000 A TW 108101000A TW I708194 B TWI708194 B TW I708194B
Authority
TW
Taiwan
Prior art keywords
roasting
coffee
training
degree
time
Prior art date
Application number
TW108101000A
Other languages
Chinese (zh)
Other versions
TW202026957A (en
Inventor
沈岱範
吳啟弘
林俊慧
林煥然
Original Assignee
國立雲林科技大學
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 國立雲林科技大學 filed Critical 國立雲林科技大學
Priority to TW108101000A priority Critical patent/TWI708194B/en
Publication of TW202026957A publication Critical patent/TW202026957A/en
Application granted granted Critical
Publication of TWI708194B publication Critical patent/TWI708194B/en

Links

Images

Landscapes

  • Image Analysis (AREA)
  • Tea And Coffee (AREA)

Abstract

本發明係關於一種咖啡豆烘焙度即時估測方法,得包含下述步驟:一取得咖啡生豆資訊步驟,得包含產地、品種、季節,含水量等咖啡生豆相關資訊,並作成一樣品烘培度影像資料庫,供即時估測模型訓練及測試之用;一進行烘培步驟,係以攝影機,配合照明,取得烘培中咖啡豆視訊或影像,同時以各種感測器取得並記錄咖啡烘培資訊,其得包含室溫、爐內溫度、烘培時間、烘培時的聲音、氣體成份分析等,做為即時估測模型訓練及測試之用;一演算法步驟,係將該視訊或影像與樣品烘培度影像進行比對,且以一演算法配合故測模型即時估測咖啡烘培度,得據以作記錄、顯示或控制咖啡烘培機的烘培作業,直至烘培結束。 The present invention relates to a method for instantly estimating the roasting degree of coffee beans, which includes the following steps: a step of obtaining green coffee bean information, including the origin, variety, season, and moisture content of the green coffee beans, and preparing a sample roast The training image database is used for real-time estimation model training and testing; for the roasting step, a camera and lighting are used to obtain video or images of roasting coffee beans, and various sensors are used to obtain and record coffee Baking information, which includes room temperature, oven temperature, baking time, sound during baking, gas composition analysis, etc., is used for real-time estimation model training and testing; an algorithm step is to use the video Or compare the image with the image of the sample roasting degree, and use an algorithm to cooperate with the test model to estimate the coffee roasting degree in real time, which can be used to record, display or control the roasting operation of the coffee roaster until it is roasted End.

Description

咖啡豆烘焙度即時估測方法 Instant estimation method of coffee bean roasting degree

本發明涉及一種烘焙咖啡豆之技術範疇,尤指咖啡豆烘焙度的即時自動辨識方法 The invention relates to a technical category of roasted coffee beans, in particular to a method for real-time automatic identification of roasting degree of coffee beans

傳統的咖啡豆烘焙方式係將咖啡豆放入烘焙裝置以進行加熱烘焙。在烘焙過程中,烘焙師配合參考Artisan時間-溫度曲線以控制烘焙溫度,並不時地透過取樣勺觀看豆子的顏色,用鼻聞散發的香氣,用耳朵聽豆子第一爆裂或二次爆裂聲,直到取樣時看到想要的烘焙程度為止,最後下豆並以風扇及攪拌快速冷卻。上述第三步就是停止烘焙,下豆並且降溫,烘焙師會以強力的風扇吹咖啡豆,以及配合攪拌,已達到迅速降溫,並達到預設的咖啡烘焙程度。 The traditional coffee bean roasting method is to put the coffee beans into the roasting device for heating and roasting. During the roasting process, the roaster used the Artisan time-temperature curve to control the roasting temperature. From time to time, he watched the color of the beans through the sampling spoon, smelled the aroma with his nose, and listened to the first or second cracking of the beans with his ears. , Until you see the desired degree of roasting when sampling, finally put the beans and cool them quickly with a fan and stirring. The third step above is to stop roasting, put the beans and cool down. The roaster will blow the coffee beans with a powerful fan and stir them together to achieve a rapid cooling and reach the preset coffee roasting level.

在咖啡豆的烘焙過程中,咖啡生豆的水分慢慢釋放,重量減輕,顏色加深,體積膨脹,含有香氣的油脂慢慢釋放出來。生豆中原本含有的大量綠原酸,會隨著烘焙的過程逐漸消失,並釋放出好聞的水果酸,其香氣隨著烘焙程度有所差異,所以要滿足各方不同烘焙風味的需求,烘焙度的掌握是咖啡豆烘焙過程中最重要的功夫。 During the roasting process of coffee beans, the moisture of the green coffee beans is slowly released, the weight is reduced, the color is darkened, the volume expands, and the aroma-containing oil is slowly released. The large amount of chlorogenic acid originally contained in raw beans will gradually disappear with the baking process and release good-smelling fruit acid. Its aroma varies with the degree of baking, so it is necessary to meet the needs of different baking flavors from all parties. The mastery of roasting degree is the most important effort in the roasting process of coffee beans.

目前烘焙度的掌握,主要是在烘焙過程中,依靠烘焙師頻繁的取樣,再其依烘焙師的個人經驗及對照SCAA烘焙程度色卡,進行烘焙程度的判斷及下豆的時機。然而,咖啡界最精密最權威的烘焙指標是以Agtron公司的近紅外 線測焦糖分析儀離線所測得的烘焙指標值100-0分別代表烘焙程度從最淺到最深,如圖26所示。烘焙過程及時參考用的八種粗分SCAA烘焙程度、烘焙豆爆裂聲,與其對照精密的Agtron烘焙指標。 At present, the mastery of the degree of baking is mainly based on the frequent sampling of the roaster during the baking process, and then based on the roaster's personal experience and the SCAA baking degree color chart to judge the degree of baking and the timing of placing the beans. However, the most precise and authoritative roasting indicator in the coffee industry is Agtron’s NIR The roasting index value 100-0 measured by the line-measured caramel analyzer offline respectively represents the degree of roasting from the shallowest to the deepest, as shown in Figure 26. In the roasting process, refer to the eight kinds of coarse SCAA roasting degree and the cracking sound of roasted beans, and compare them with the precise Agtron roasting index.

上述傳統的咖啡豆烘焙,具有如下缺失: The above-mentioned traditional roasting of coffee beans has the following shortcomings:

1.在傳統咖啡豆烘焙過程,烘焙師會不定時的取樣觀看現在咖啡豆的顏色,並依經驗或與色卡做比對,以便即時判斷咖啡豆的烘焙程度。但是只能頻繁從烘焙的豆子中取樣才能得到資訊,且烘焙師的精神狀況及烘焙室的照明光源光譜等都會造成人工的色卡比對誤差。 1. In the traditional coffee bean roasting process, the roaster will take samples from time to time to watch the color of the coffee beans, and compare them with the color chart based on experience to judge the roasting degree of the coffee beans in real time. However, information can only be obtained by sampling frequently from roasted beans, and the mental state of the roaster and the light source spectrum of the roasting room will cause artificial color chart comparison errors.

2.Agtron近紅外線測焦糖分析儀無法進行即時估測,雖然Agtron近紅外線測焦糖分析儀的烘焙度是咖啡烘焙界的權威指標,但是近紅外線會受到烘焙高溫的影響,因此只能離線人工操作來進行其烘焙度的辨識,以致無法即時辨識咖啡豆的烘焙度。 2. Agtron near-infrared caramel analyzer cannot perform real-time estimation. Although the roasting degree of Agtron near-infrared caramel analyzer is an authoritative indicator in the coffee roasting industry, near-infrared is affected by the high temperature of roasting, so it can only be offline Manual operation is performed to recognize the roasting degree, so that the roasting degree of coffee beans cannot be recognized in real time.

緣此,本發明人於是發明出一種咖啡豆烘焙度即時估測方法,故本發明之主要目的在於:提供可即時辨識的一種咖啡豆烘焙度即時估測方法;本發明之次要目的在於:增進烘焙度辨識精確度的一種咖啡豆烘焙度即時估測方法。 For this reason, the inventor invented a method for instantly estimating the roasting degree of coffee beans. Therefore, the main purpose of the present invention is to provide an instant-identifiable method for estimating the roasting degree of coffee beans; the secondary purpose of the present invention is to: A method for real-time estimation of roasting degree of coffee beans to improve the recognition accuracy of roasting degree.

為達上述目的,本發明運用了下述技術手段:本發明係關於一種咖啡豆烘焙度即時估測方法,得包含下述步驟:一取得咖啡生豆資訊步驟,得包含產地、品種、季節,含水量等咖啡生豆相關資訊,並作成一樣品烘培度影像資料庫,供即時估測模型訓練及測試之用;一進行烘培步驟,係以攝影機,配合照明,取得烘培中咖啡豆視訊或影像,同 時以各種感測器取得並記錄咖啡烘培資訊,其得包含室溫、爐內溫度、烘培時間、烘培時的聲音、氣體成份分析等,做為即時估測模型訓練及測試之用;一演算法步驟,係將該視訊或影像與樣品烘培度影像進行比對,且以一演算法配合故測模型即時估測咖啡烘培度,得據以作記錄、顯示或控制咖啡烘培機的烘培作業,直至烘培結束。 To achieve the above objective, the present invention employs the following technical means: The present invention relates to a method for real-time estimation of roasting degree of coffee beans, which may include the following steps: a step of obtaining green coffee bean information may include the origin, variety, and season, Moisture content and other information about green coffee beans, and create a sample roasting degree image database for real-time estimation model training and testing; the roasting step is carried out with a camera and lighting to obtain roasted coffee beans Video or image, the same Various sensors are used to obtain and record coffee roasting information, including room temperature, oven temperature, roasting time, roasting sound, gas composition analysis, etc., for real-time estimation model training and testing ; An algorithm step is to compare the video or image with the sample roasting degree image, and use an algorithm to cooperate with the test model to estimate the coffee roasting degree in real time, which can be used to record, display or control coffee roasting The baking operation of the cultivator until the baking ends.

所述該咖啡豆烘焙度即時估測方法,係基於卷積類神經網路「時間順序二元分類模型」之深度學習技術,其包含下述步驟:一咖啡豆烘焙度設定步驟,係在適用咖啡豆烘焙分類的一時間順序二元分類模型選用一烘焙度分類;一攝錄影步驟,係對烘培過程中的咖啡豆進行攝錄影;一影像擷取步驟,係以ROI擷取方式進行即時擷取該錄影成影像;及一估測步驟,係輸入擷取影像於該時間順序二元分類模型,以進行烘焙度估測演算程序;藉由上述步驟,系統得即時估測並告知烘培師(人或機器)目前的烘焙度分類,若達到所設定烘焙度分類,則烘培師(人或機器)可停止烘焙並下豆冷卻。 The method for real-time estimation of the roasting degree of coffee beans is based on the deep learning technology of a convolutional neural network "time sequential binary classification model", which includes the following steps: a coffee bean roasting degree setting step is applied A chronological binary classification model of coffee beans roasting classification uses a roasting degree classification; a video recording step is to record coffee beans during the roasting process; an image capturing step is to capture ROI Perform real-time capture of the recorded video into an image; and an estimation step, which is to input the captured image into the chronological binary classification model to perform the baking degree estimation calculation process; through the above steps, the system obtains real-time estimation and notification The current roasting degree classification of the baker (man or machine), if it reaches the set roasting degree classification, the baker (man or machine) can stop roasting and place the beans to cool.

上述該時間順序二元分類模型進行烘焙度估測演算步驟:步驟(1):設定該時間順序二元分類模型的起始參數設定:二元模型計數器k=1、連續次數的門檻值T=4,連續次數計數器t=0,預定烘焙度分類I;步驟(2):切換至P k 二元模型以辨識第k及k+1類;步驟(3):輸入下一個畫面至P k 做分類;步驟(4):分類的結果是否為第k+1類?如果是則t=t+1,如果否,則t=0,並回到上述步驟(3);步驟(5):是否t=T?,如果是,則進入下個步驟(6),如果否,則進入上述步驟(3);步驟(6):是否k+1=I?如果是,則宣告"已達預定烘焙度第I分類"並結束演算法,如果否,則i=k+1,宣告現在進入第i類烘焙度,回到上述步驟(2)。 The above-mentioned time sequence binary classification model performs baking degree estimation calculation steps: Step (1): Set the initial parameter setting of the time sequence binary classification model: binary model counter k=1, threshold value of consecutive times T= 4. The continuous counter t=0, the predetermined baking degree classification I; Step (2): Switch to the P k binary model to identify the kth and k+1 categories; Step (3): Input the next screen to P k to do Classification; Step (4): Is the result of classification the k+1 class? If yes, then t=t+1, if not, then t=0, and go back to the above step (3); Step (5): Is t=T? , If yes, go to the next step (6), if not, go to the above step (3); step (6): whether k+1=I? If it is, it declares "has reached the first category of the predetermined baking degree" and ends the algorithm. If not, then i=k+1, it is declared that it has entered the i-th type of baking degree, and the above step (2) is returned.

上述該時間順序二元分類模型的輸入為第k類影像訓練集BA,而輸出則為P k 二元模型,又該P k 二元模型的訓練步驟如下述:步驟(1):取RGB訓練影像集BA中屬於第k類以及第k+1類訓練影像集;步驟(2):將取出影像分訓練及驗證;步驟(3):開始訓練。 The input of the above-mentioned time sequence binary classification model is the k-th image training set BA, and the output is the P k binary model, and the training steps of the P k binary model are as follows: Step (1): Take RGB training The image set BA belongs to the k-th type and the k+1-th type training image set; step (2): extract the images into training and verification; step (3): start training.

上述該第k類影像訓練集BA的製作方式係更包含有:步驟(1):製作訓練影像B TIB(Training Images(Baking));步驟(2):增加訓練集影像數量,形成訓練影像TIBA(Training Images(Baking)(augmentation)),即將前述步驟(1)取得之第K類烘焙度訓練影像集BA為基礎,採用資料增強(data augmentation)技術以增加訓練影像集數量,藉資料增強(data augmentation)技術可提升到3600(50x72)張。 The above-mentioned method for making the k-th image training set BA further includes: Step (1): Make training images B TIB (Training Images (Baking)); Step (2): Increase the number of training set images to form training images TIBA (Training Images(Baking)(augmentation)), that is, based on the type K baking degree training image set BA obtained in the previous step (1), using data augmentation technology to increase the number of training image sets, and use data to enhance ( data augmentation) technology can be upgraded to 3600 (50x72) sheets.

所述該咖啡豆烘焙度即時估測方法,係「基於卷積神經網路法」,其包含下述步驟:一咖啡豆烘焙度設定步驟,係在適用咖啡豆烘焙分類的一卷積神經網路模型選用一烘焙度分類;一攝錄影步驟,係對烘培過程中的咖啡豆進行攝錄影;一影像擷取步驟,係以ROI擷取方式進行即時擷取該錄影成影像;及一估測步驟,係將所擷取影像與該卷積神經網路模型所選用的烘焙度分類兩者進行估測;藉由上述步驟,若咖啡豆的烘焙過程中達到所設定烘焙度分類,則進行停止烘焙並下豆冷卻。 The method for real-time estimation of the roasting degree of coffee beans is based on the "convolutional neural network method", which includes the following steps: a coffee bean roasting degree setting step is based on a convolutional neural network suitable for coffee bean roasting classification The road model uses a roasting degree classification; a video recording step is to record the coffee beans in the roasting process; an image capturing step is to capture the video into an image in real time by ROI capture; and An estimation step is to estimate both the captured image and the roasting degree classification selected by the convolutional neural network model; through the above steps, if the coffee beans reach the set roasting degree classification during the roasting process, Then stop roasting and put the beans to cool.

上述所使用該卷積神經網路模型係更包含下述:步驟(1)置入已烘培製作完成的樣本咖啡豆;步驟(2)進行第K類樣本咖啡豆不加熱烘培;步驟(3)錄製第K類樣本咖啡豆烘培視訊;步驟(4)製作RGB影像集;步驟(5)卷積神經網路訓練及參數調整。 The convolutional neural network model used above further includes the following: step (1) placing the roasted sample coffee beans; step (2) roasting the K-th sample coffee beans without heating; step ( 3) Record the roasting video of type K sample coffee beans; step (4) make RGB image set; step (5) convolutional neural network training and parameter adjustment.

上述所使用樣本咖啡豆係設為對應Agtron值的10類樣品咖啡豆。 The sample coffee beans used above are set to 10 types of sample coffee beans corresponding to the Agtron value.

上述所使用卷積神經網路訓練及參數調整係更包含下述:步驟(1)參考CNN模型;步驟(2)修改CNN模型的FEP參數;步驟(3)輸入該RGB影像集開始訓練;步驟(4)測試並決定最佳參數。 The convolutional neural network training and parameter adjustment system used above further includes the following: step (1) refer to the CNN model; step (2) modify the FEP parameters of the CNN model; step (3) input the RGB image set to start training; step (4) Test and determine the best parameters.

上述該FEP參數係告包含有卷積層卷積核的大小、激勵函數、池化層的濾波器大小及其步驟、咖啡烘焙度顏色的色彩空間。 The above-mentioned FEP parameter system includes the size of the convolution kernel of the convolutional layer, the excitation function, the size of the filter of the pooling layer and its steps, and the color space of the coffee roasting color.

本發明藉由上述技術手段,可以達成如下功效: Through the above technical means, the present invention can achieve the following effects:

1.本發明可提供比傳統廣泛使用的時間-溫度曲線更直接反映烘焙度的時間-烘焙度曲線。雖然標準咖啡Agtron烘焙度是以紅外線量測焦糖指數而得,但也與彩色及形狀資訊高度相關。因此,本發明將烘培度分成十類(等級),採用一般彩色攝影機取像,並以深度學習的卷積神經網路作咖啡烘培度訓練而得一咖啡豆烘焙時間與烘培度之曲線圖,俾供欲烘培咖啡豆之即時辨識。 1. The present invention can provide a time-baking degree curve that more directly reflects the baking degree than the traditional and widely used time-temperature curve. Although the standard coffee Agtron roast degree is obtained by measuring the caramel index by infrared, it is also highly correlated with color and shape information. Therefore, the present invention divides the roasting degree into ten categories (levels), uses a general color camera to take the image, and uses a deep learning convolutional neural network for coffee roasting degree training to obtain a coffee bean roasting time and roasting degree The graph is for real-time identification of roasted coffee beans.

2.因為實際烘焙咖啡豆時,烘焙度Agtron值應當是隨時間遞減(Monotonically Decreasing),若當前烘焙度的類別為第k類,則下一個類別一定是第k+1類,故本發明提出「時間順序二元分類模型(Temporal Sequential Binary Classifier,TSBC)」,若類別總數為K類,則此模型是由K-1個二元分類模型組成的。第P k 個二元分類模型只分類第k類以及第k+1類,

Figure 108101000-A0305-02-0006-20
。因每次只分兩類,其精準度預期將可大幅提升,且不會產生烘焙度順序錯誤現象。 2. When the coffee beans are actually roasted, the Agtron value of the roasting degree should be Monotonically Decreasing. If the current roasting degree category is the kth category, the next category must be the k+1th category, so the present invention proposes "Temporal Sequential Binary Classifier (TSBC)", if the total number of categories is K, this model is composed of K-1 binary classification models. The P k- th binary classification model only classifies the k- th category and the k+1-th category,
Figure 108101000-A0305-02-0006-20
. Since there are only two categories at a time, its accuracy is expected to be greatly improved, and there will be no wrong baking order.

A:基於時間順序二元分類法的咖啡豆烘焙度即時估測方法 A: Instant estimation method of coffee beans roasting degree based on chronological binary classification

B:基於卷積神經網路法的咖啡豆烘焙度即時估測方法 B: Real-time estimation method of coffee beans roasting degree based on convolutional neural network method

圖1:係為本發明咖啡豆烘焙度即時估測方法之步驟流程圖。 Figure 1: is a flow chart of the steps of the instant estimation method of coffee beans roasting degree of the present invention.

圖2:係為本發明基於時間順序二元分類法的咖啡豆烘焙度即時估測方法之步驟流程圖。 Fig. 2 is a flow chart of the steps of the instant estimation method of coffee beans roasting degree based on the chronological binary classification method of the present invention.

圖3:係為本發明時間順序二元分類演算法之流程圖。 Figure 3: is a flowchart of the time sequence binary classification algorithm of the present invention.

圖4:係為本發明時間順序二元分類模型之訓練流程圖。 Figure 4: is a training flowchart of the time sequence binary classification model of the present invention.

圖5:係為本發明製作RGB影像訓練集BA之步驟流程圖。 Figure 5: is a flow chart of the steps of making the RGB image training set BA of the present invention.

圖6:係為本發明訓練影像集BA TIBA之資料資強(data Augmentation)手段示意圖,其中(a)旋轉(b)水平翻轉(c)裁切。 Fig. 6 is a schematic diagram of the data augmentation method of the training image set BA TIBA of the present invention, in which (a) rotation (b) horizontal flipping (c) cropping.

圖7:係為本發明基於卷積神經網路法的咖啡豆烘焙度即時估測方法之步驟流程圖。 Fig. 7 is a flow chart of the steps of the instant coffee bean roasting degree estimation method based on the convolutional neural network method of the present invention.

圖8:係為本發明製作RGB影像訓練集之步驟流程圖。 Fig. 8 is a flow chart of the steps of making an RGB image training set in the present invention.

圖9:係為本發明關於Agtron值的10類樣品咖啡豆的色澤圖。 Fig. 9 is a color map of 10 types of coffee beans with respect to Agtron value of the present invention.

圖10:係為本發明製作對應Agtron值的10類樣品咖啡豆之步驟流程圖。 Fig. 10 is a flow chart of the steps for making 10 types of sample coffee beans corresponding to the Agtron value in the present invention.

圖11:係為本發明製作適用於咖啡豆烘焙度辨識的卷積神經網路模型之步驟流程圖。 Fig. 11 is a flow chart of the steps of making a convolutional neural network model suitable for coffee bean roasting degree recognition according to the present invention.

圖12:係為本發明的參考卷積神經網路模型(參考CNN模型)。 Figure 12: This is the reference convolutional neural network model of the present invention (refer to the CNN model).

圖13:係為本發明適用於咖啡豆烘焙度辨識的CNN模型。 Figure 13: This is a CNN model suitable for the identification of coffee beans roasting degree according to the present invention.

圖14:係為本發明影像中的煙霧(a)少量煙霧(b)大量煙霧得比較圖。 Figure 14 is a comparison diagram of smoke (a) a small amount of smoke (b) a large amount of smoke in the image of the present invention.

圖15:使用TSBC測試的10類樣本咖啡豆烘焙視訊測試折線圖。 Figure 15: Line graph of 10 types of coffee beans roasting video test using TSBC test.

圖16:係關於Artisan的咖啡豆烘焙時間與烘培溫度之曲線圖。 Figure 16: A graph showing the roasting time and roasting temperature of Artisan coffee beans.

首先,請參閱圖1所示,本發明係關於一種咖啡豆烘焙度即時估測方法,以攝影機(可見光或不可見光)配合適當之照明(打光)(可見光或不可見光)即時取得烘培中的咖啡豆影像,並得以適當之感測器取得咖啡烘培中相關資訊,綜上面一種或多種資訊為輸入,由適當之演算法,即時估測咖啡豆之烘培 程度。步驟一:取得咖啡生豆相關資訊,如產地品種季節,水洗或日曬的處理方式,含水量等咖啡生豆相關資訊,並作成一樣品烘培度影像資料庫;步驟二:進行烘培時,以適當之(可見光及或不可見光)攝影機,配合適當之照明,取得烘培中咖啡豆視訊或影像。同時,以其他適當之感測器取得並記錄咖啡烘培相關資訊,如室溫、爐內溫度,烘培時間,烘培時的聲音,氣體成分分析等;及步驟三:係將該視訊或影像與樣品烘培度影像進行比對,且以一演算法即時估測咖啡烘培度,據以作記錄、顯示或控制咖啡烘培機的烘培作業,直至烘培結束。 First of all, please refer to Figure 1. The present invention relates to a method for real-time roasting degree estimation of coffee beans, which uses a camera (visible light or invisible light) and appropriate lighting (lighting) (visible light or invisible light) to obtain instant roasting The image of coffee beans can be obtained by appropriate sensors to obtain relevant information during coffee roasting. Based on one or more of the above information as input, the appropriate algorithm can estimate the roasting of coffee beans in real time degree. Step 1: Obtain information about green coffee beans, such as the season of origin, washing or sun treatment, and moisture content of green coffee beans, and create a sample roasting degree image database; Step 2: When roasting , Use appropriate (visible light and or invisible light) cameras with appropriate lighting to obtain video or images of roasting coffee beans. At the same time, use other appropriate sensors to obtain and record coffee roasting related information, such as room temperature, oven temperature, roasting time, sound during roasting, gas composition analysis, etc.; and Step 3: This video or The image is compared with the image of the roasting degree of the sample, and an algorithm is used to estimate the roasting degree of coffee in real time, which can be used to record, display or control the roasting operation of the coffee roaster until the roasting is completed.

請參閱圖2所示,本發明係關於一種咖啡豆烘焙度即時估測方法,如圖2所示,係為基於時間順序二元分類法的咖啡豆烘焙度即時估測方法A,其包含下述步驟:一咖啡豆烘焙度設定步驟,係在適用咖啡豆烘焙分類的一時間順序二元分類模型(Temporal Sequential Binary Classifier,簡稱TSBC)選用一烘焙度分類;一攝錄影步驟,係對烘培過程中的咖啡豆進行攝錄影;一影像擷取步驟,係以ROI擷取方式進行即時擷取該錄影成影像;及一估測步驟,係輸入擷取影像於該時間順序二元分類模型,以進行烘焙度估測演算程序;藉由上述步驟,若咖啡豆的烘焙過程中達到所設定烘焙度分類,則進行停止烘焙並下豆冷卻。 Please refer to Figure 2. The present invention relates to a coffee bean roasting degree instant estimation method. As shown in Figure 2, it is a coffee bean roasting degree instant estimation method A based on a chronological binary classification method, which includes the following The steps described: a step of setting the roasting degree of coffee beans, which is based on a Temporal Sequential Binary Classifier (TSBC) suitable for coffee roasting classification, selecting a roasting degree classification; The coffee beans in the training process are captured and recorded; an image capture step is to capture the recorded video into an image in real time by ROI capture; and an estimation step is to input the captured image in the time sequence binary classification The model is used to perform the roasting degree estimation calculation program; through the above steps, if the coffee beans reach the set roasting degree classification during the roasting process, the roasting is stopped and the beans are cooled.

上述咖啡豆烘焙度即時估測方法,如圖3所示者,其中該時間順序二元分類模型(TSBC)進行烘焙度估測演算步驟如下: The above-mentioned method for real-time roasting degree estimation of coffee beans is as shown in Fig. 3, wherein the chronological binary classification model (TSBC) performs roasting degree estimation calculation steps as follows:

步驟(1):設定該時間順序二元分類模型的起始參數設定:二元模型計數器k=1、連續次數的門檻值T=4,連續次數計數器t=0,預定烘焙度分類I。 Step (1): Set the initial parameter settings of the chronological binary classification model: binary model counter k=1, continuous number threshold T=4, continuous number counter t=0, predetermined baking degree classification I.

步驟(2):切換至P k 二元模型以辨識第k及k+1類。 Step (2): Switch to the P k binary model to identify the k and k +1 types.

步驟(3):輸入下一個畫面至P k 做分類。 Step (3): Input the next picture to P k for classification.

步驟(4):分類的結果是否為第k+1類?如果是則t=t+1,如果否,則t=0,並回到上述步驟(3)。 Step (4): Is the result of classification the k+1 class? If yes, then t = t +1, if not, then t =0, and return to the above step (3).

步驟(5):是否t=T?,如果是,則進入下個步驟(6),如果否,則進入上述步驟(3)。 Step (5): Is t=T? , If yes, go to the next step (6), if not, go to the above step (3).

步驟(6):是否k+1=I?如果是,則宣告"已達預定烘焙度第I分類"並結束演算法,如果否,則i=k+1,宣告現在進入第i類烘焙度,回到上述步驟(2)。 Step (6): Is k+1=I? If it is, it declares "has reached the first category of the predetermined baking degree" and ends the algorithm. If not, then i=k+1, it is declared that it has entered the i-th type of baking degree, and the above step (2) is returned.

進一步,上述該時間順序二元分類模型(TSBC)的訓練流程,如圖4所示。因為TSBC是多個二元分類器所組成的

Figure 108101000-A0305-02-0009-22
,如果類別總數為K,則由K-1個二元分類模型依序運作而成。P k 二元模型訓練流程的輸入為第k類影像訓練集BA,而輸出則為P k 二元模型,其訓練步驟如下述: Further, the above-mentioned training process of the temporal sequential binary classification model (TSBC) is shown in FIG. 4. Because TSBC is composed of multiple binary classifiers
Figure 108101000-A0305-02-0009-22
, If the total number of categories is K, then K-1 binary classification models are operated in sequence. The input of the P k binary model training process is the k-th image training set BA, and the output is the P k binary model. The training steps are as follows:

步驟(1):取RGB訓練影像集BA中屬於第k類以及第k+1類訓練影像集。在此每次只取連續兩類訓練影像集,k初始值為1,所以剛開始將會取第1類以及第2類。 Step (1): Take a training image set belonging to the kth category and the k+1th category in the RGB training image set BA. Here, only two consecutive types of training image sets are taken each time, and the initial value of k is 1, so at the beginning, the first and second types will be selected.

步驟(2):將取出影像分訓練及驗證。每一類的影像為3600張,隨機分為:90%訓練以及10%驗證,因為將用烘焙視訊測試,所以在此沒有測試影像。 Step (2): The extracted image will be divided into training and verification. There are 3,600 images in each category, randomly divided into: 90% training and 10% verification. Because the baked video test will be used, there is no test image here.

步驟(3):開始訓練。在這步驟會使用訓練影像集做訓練,並在每個epoch之後使用驗證影像集驗證準確率,並保留準確率最高的權重,就能得到P k ,重複上述步驟直到當

Figure 108101000-A0305-02-0009-23
,就能得到TSBC模型
Figure 108101000-A0305-02-0009-24
。 Step (3): Start training. In this step, the training image set will be used for training, and the verification image set will be used to verify the accuracy after each epoch, and the weight with the highest accuracy will be retained to obtain P k . Repeat the above steps until the
Figure 108101000-A0305-02-0009-23
, You can get the TSBC model
Figure 108101000-A0305-02-0009-24
.

進一步,上述該RGB影像訓練集BA的製作方式,如圖5所示,係直接輸入製作樣本咖啡豆的第k類樣本咖啡豆烘焙視訊,取其最後50個訊框製作RGB影像訓練集B TIB(Training Images(Baking)),且每類訓練影像數量設為 50訊框,如此較能貼切反映加熱烘焙時的實際咖啡豆色澤與煙霧狀況,最後增加影像數量,而得到RGB影像訓練集A TIBA(Training Images(Baking)(A ugmentation))。 Further, the method of making the RGB image training set BA, as shown in Figure 5, is to directly input the k-th sample coffee bean roasting video for making sample coffee beans, and take the last 50 frames to make the RGB image training set B TIB (Training Images(Baking)), and the number of training images for each type is set to 50 frames, which can better reflect the actual coffee bean color and smoke conditions during heating and roasting. Finally, the number of images is increased to obtain the RGB image training set A TIBA (Training Images (Baking) (A ugmentation)).

步驟(1):製作訓練影像B TIB(Training Images(Baking))。其中第k類訓練影像集TIB_k的製作方式為輸入第K類樣本咖啡豆烘焙視訊,僅取視訊最後T=2秒的訊框。因為在我們實驗架構中,取像畫面包含其他非咖啡豆的物體,故擷取只含咖啡豆的50x50方形區塊。因播放時的訊框率設定為25f/s,故TIB_k數量為25x2=50張。TIB={TIB_k,k=1,2,..K}影像數目總數為50x10=500 Step (1): Make training images B TIB (Training Images (Baking)). The production method of the k-th training image set TIB_k is to input the K-th sample coffee bean roasting video, and only take the frame of the last T=2 seconds of the video. Because in our experimental framework, the image capture screen contains other objects that are not coffee beans, we capture a 50x50 square block containing only coffee beans. Since the frame rate during playback is set to 25f/s, the number of TIB_k is 25x2=50 frames. TIB={TIB_k, k=1,2,..K} The total number of images is 50x10=500

步驟(2):增加訓練集影像數量,形成訓練影像TIBA(Training Images(Baking)(augmentation))。訓練集量太少,將造成模型訓練不足;若要有足夠的訓練量,雖可增加T以增加Tx25訓練影像集數量,但咖啡烘焙度隨時間越變越快,增加T將讓訓練集包含太多較第K類最終烘焙度為淺的訓練影像。這是時間順序取樣的兩難挑戰,值得後續繼續探討。 Step (2): Increase the number of images in the training set to form a training image TIBA (Training Images (Baking) (augmentation)). If the amount of training set is too small, it will cause insufficient training of the model; if there is enough training amount, although T can be increased to increase the number of Tx25 training image sets, the coffee roasting degree becomes faster and faster with time. Increasing T will allow the training set to include Too many training images with a lower final baking degree than the K-th category. This is the dilemma of time-sequential sampling, which is worthy of further discussion.

本發明以前述步驟(1)取得之第K類烘焙度訓練影像集BA為基礎,採用資料增強(data augmentation)技術以增加訓練影像集數量:首先,將每張100x100的訓練影像旋轉,再加上旋轉90度3次(90度、180度、270度)擴展成四張100x100影像,如圖6(a)所示。每張影像再裁切成9張子影像,如圖6(c)所示,下一步為水平翻轉,將輸入影像水平(左右)翻轉,如圖6(b)所示,再重複上述旋轉及裁切步驟,所以最後可拓展成72(4x9x2)張50x50的子影像。故,該步驟(1)取得的50張100x100影像,藉資料增強(data augmentation)技術可提升到3600(50x72)張,稱為訓練影像集B。 The present invention is based on the K-th baking degree training image set BA obtained in the aforementioned step (1), and adopts data augmentation technology to increase the number of training image sets: first, rotate each 100x100 training image, and then add Rotate up 90 degrees 3 times (90 degrees, 180 degrees, 270 degrees) to expand into four 100x100 images, as shown in Figure 6(a). Each image is then cropped into 9 sub-images, as shown in Figure 6(c), the next step is to flip horizontally, flip the input image horizontally (left and right), as shown in Figure 6(b), and repeat the above rotation and cropping Cut steps, so it can finally be expanded into 72 (4x9x2) 50x50 sub-images. Therefore, the 50 100x100 images obtained in this step (1) can be upgraded to 3600 (50x72) images by data augmentation technology, which is called the training image set B.

本發明關於另一種咖啡豆烘焙度即時估測方法,即基於卷積神經網路法的咖啡豆烘焙度即時估測方法B,如圖7所示,係包含下述步驟:一咖啡豆烘焙度設定步驟,係在適用咖啡豆烘焙分類的一卷積神經網路(Convolution Neural Network,簡稱CNN)模型選用一烘焙度分類;一攝錄影步驟,係對烘培過程中的咖啡豆進行攝錄影;一影像擷取步驟,係以ROI擷取方式進行即時擷取該錄影成影像,因訊框畫面非全部是咖啡豆,故需取出僅含咖啡豆的50x50方形區塊;及一估測步驟,係將所擷取影像與該卷積神經網路模型所選用的烘焙度分類兩者進行估測,當CNN分類輸出類別(2-10類)達到使用者設定的烘焙度類別,系統會發出「已達到目標xx類烘焙度Agtron xx度」,提醒使用者立即進入停止烘焙並下豆冷卻;藉由上述步驟,若咖啡豆的烘焙過程中達到所設定烘焙度分類,則進行停止烘焙並下豆冷卻。 The present invention relates to another method for real-time estimation of roasting degree of coffee beans, namely method B for real-time estimation of roasting degree of coffee beans based on the convolutional neural network method. As shown in FIG. 7, it includes the following steps: The setting step is to select a roasting degree classification in a Convolution Neural Network (CNN) model suitable for coffee roasting classification; a video recording step is to record coffee beans in the roasting process An image capture step is to capture the video into an image in real time by ROI capture method. Because the frame screen is not all coffee beans, it is necessary to take out a 50x50 square block containing only coffee beans; and an estimation The step is to estimate both the captured image and the baking degree classification selected by the convolutional neural network model. When the CNN classification output category (2-10 categories) reaches the baking degree category set by the user, the system will "Target xx roasting degree Agtron xx degree has been reached" is issued to remind the user to immediately stop roasting and cooling the beans; through the above steps, if the coffee beans reach the set roasting degree classification during the roasting process, stop roasting and Place the beans to cool.

在上述咖啡豆烘焙度即時估測方法,如圖8所示,其中所使用該卷積神經網路模型,以更包含下述步驟製作:步驟(1)入已烘培製作完成的樣本咖啡豆,且共有K類樣本咖啡;步驟(2)進行第K類樣本咖啡豆不加熱烘培;步驟(3)錄製第K類樣本咖啡豆烘培視訊;步驟(4)製作RGB影像集;步驟(5)卷積神經網路訓練及參數調整。 In the above-mentioned method for real-time estimation of roasting degree of coffee beans, as shown in FIG. 8, the convolutional neural network model used therein further includes the following steps: Step (1) Enter the roasted sample coffee beans , And there are K sample coffees; step (2) roasting the K sample coffee beans without heating; step (3) recording the roasting video of the K sample coffee beans; step (4) making RGB image set; step ( 5) Convolutional neural network training and parameter adjustment.

特別一提,所使用樣本咖啡豆係設為對應Agtron值的10類樣品咖啡豆(其中含一生豆樣品),而該Agtron值的10類樣品咖啡豆的色澤如圖9所示;另,基於Agtron的10類樣品咖啡豆的製造方法,如圖20所示,係包含下述步驟:步驟(1)準備與設定;步驟(2)入豆及攝錄影;步驟(3)停止錄影,同時(或立即)下豆排熱冷卻;步驟(4)測定Agtron烘焙度。經由上述樣品咖啡豆的製造方法,如 此,便可獲得基於Agtron值的第K類樣本咖啡豆及第K類樣本咖啡豆烘焙視訊,其中K=2、3、4...10。 In particular, the sample coffee beans used are set to 10 types of sample coffee beans corresponding to the Agtron value (including the whole-life bean samples), and the color of the 10 types of sample coffee beans with the Agtron value is shown in Figure 9; The manufacturing method of Agtron’s 10 sample coffee beans, as shown in Figure 20, includes the following steps: step (1) preparation and setting; step (2) bean insertion and video recording; step (3) stop video recording and at the same time (Or immediately) remove heat and cool down the beans; step (4) measure the Agtron roasting degree. Through the above-mentioned sample coffee bean manufacturing method, such as In this way, you can obtain the K-th sample coffee beans and the K-th sample coffee roasting video based on the Agtron value, where K=2, 3, 4...10.

在上述咖啡豆烘焙度即時估測方法,如圖21所示,其中所使用卷積神經網路訓練及參數調整係更包含下述步驟:步驟(1)參考CNN模型,如圖22所示;步驟(2)修改CNN模型的FEP(Features Extraction Parameters,簡稱FEP)參數;步驟(3)輸入該RGB影像集開始訓練;步驟(4)測試並決定最佳參數。本發明藉由調整FEP參數之目的在於提升咖啡豆烘焙度辨識能力,以得到適用於咖啡豆烘焙度辨識的CNN模型,如圖23所示者。 In the above-mentioned real-time estimation method of coffee beans roasting degree, as shown in Figure 21, the used convolutional neural network training and parameter adjustment system further includes the following steps: Step (1) Refer to the CNN model, as shown in Figure 22; Step (2) Modify the FEP (Features Extraction Parameters, FEP) parameters of the CNN model; Step (3) Input the RGB image set to start training; Step (4) Test and determine the best parameters. The purpose of the present invention by adjusting the FEP parameters is to improve the coffee bean roasting degree recognition ability, so as to obtain a CNN model suitable for coffee bean roasting degree recognition, as shown in FIG. 23.

在上述咖啡豆烘焙度即時估測方法,其中該FEP參數係告包含有色彩空間、卷積層卷積核的大小、激勵函數、池化層的濾波器大小,而最佳FEP參數值如下表1所示。 In the above-mentioned method for real-time estimation of roasting degree of coffee beans, the FEP parameter report includes the color space, the size of the convolution kernel of the convolutional layer, the excitation function, and the filter size of the pooling layer. The optimal FEP parameter values are shown in Table 1 Shown.

Figure 108101000-A0305-02-0012-1
Figure 108101000-A0305-02-0012-1
Figure 108101000-A0305-02-0013-2
Figure 108101000-A0305-02-0013-2

本發明使用折線圖評估上述「基於卷積神經網路法的咖啡豆烘焙度即時估測方法」,以測試咖啡豆烘焙視訊的結果,縱軸為Agtron數值,橫軸為烘焙時間(秒),卷積神經網路每秒會辨識分類一次,最後將結果連起來,就可以得到樣本咖啡豆烘焙視訊測試折線圖,本發明將用此折線圖檢視,辨識分類的結果是否有符合烘焙咖啡豆的特性,確保在實際烘焙時不會有分類錯誤的情況。 The present invention uses a line graph to evaluate the "real-time estimation method of coffee beans roasting degree based on convolutional neural network method" to test the results of coffee roasting video. The vertical axis is the Agtron value and the horizontal axis is the roasting time (seconds). The convolutional neural network recognizes the classification once per second, and finally connects the results to obtain the sample coffee bean roasting video test line chart. The present invention will use this line chart to check whether the classification result is consistent with roasted coffee beans Features to ensure that there will be no classification errors during actual baking.

本發明再以估測差值評估上述「基於卷積神經網路法的咖啡豆烘焙度即時估測方法」,係以其測試咖啡豆烘焙視訊的結果,將用來檢視卷積神經網路在烘焙視訊最後一秒估測類別的Agtron值與實際受測分類Agtron值差值,如下表。 The present invention then uses the estimated difference to evaluate the "real-time coffee bean roasting degree estimation method based on the convolutional neural network method", which is the result of testing the coffee bean roasting video and will be used to view the convolutional neural network The difference between the Agtron value of the estimated category and the actual tested category Agtron value in the last second of the baking video is shown in the following table.

Figure 108101000-A0305-02-0013-3
Figure 108101000-A0305-02-0013-3

由上表可以知道,該「基於卷積神經網路法的咖啡豆烘焙度即時估測方法」作第2類、第3類、第6類以及第7類,都是完全正確,而作第8類、第9 類以及第10類,都只能分類到第7類,無法分類到更深,此原因可能是因為煙霧,如圖所示或是訓練影像與實際咖啡豆烘焙影像差異太大的關係所造成,如圖24所示。 It can be seen from the above table that the "real-time estimation method of coffee beans roasting degree based on the convolutional neural network method" is completely correct for the second, third, sixth, and seventh types. Class 8, 9 Class and Class 10 can only be classified into Class 7 and cannot be classified deeper. This may be due to smoke, as shown in the figure, or the relationship between the training image and the actual roasting image of coffee beans. Shown in Figure 24.

另關於評估「基於時間順序二元分類法的咖啡豆烘焙度即時估測方法」,本發明使用兩種評估方式(1)使用折線圖評估是否符合烘焙咖啡豆的特性(2)計算Agtron差異絕對值用來評估與Agtron近紅外線焦糖分析儀測定數值差多少,如下所述:使用折線圖評估:請參閱圖25所示,在使用折線圖評估是否符合烘焙咖啡豆的特性中,如下所示可以發現使用TSBC之後,沒有違反烘焙咖啡豆的特性情況發生,因為TSBC加入了時間順序的資訊,但是與適用於咖啡豆烘焙度辨識的卷積神經網路模型中不同的是,因為在TSBC的定義中,必須要第P k 個模型分類達連續T次的第k+1類,此時才算真正進入第k+1類,所以在折線圖圖第5類圖中的虛線框框,雖然最後是在第5類與第6中跳動,但是第6類的次數未達連續次數門檻值,所以還是在第5類。適用於咖啡豆烘焙度辨識的卷積神經網路相比,成功的解決了違反烘焙咖啡豆的特性,並且正確的辨識分類在視訊中出現煙霧的第8類、第9類以及第10類。 Regarding the evaluation of the "real-time estimation method of roasting degree of coffee beans based on the chronological binary classification method", the present invention uses two evaluation methods (1) using a line graph to evaluate whether it meets the characteristics of roasted coffee beans (2) calculating the absolute difference The value is used to evaluate the difference between the value measured by the Agtron near-infrared caramel analyzer, as follows: Use a line graph to evaluate: Please refer to Figure 25, in the use of a line graph to evaluate whether it meets the characteristics of roasted coffee beans, as shown below It can be found that after using TSBC, there is no violation of the characteristics of roasted coffee beans, because TSBC has added chronological information, but it is different from the convolutional neural network model suitable for coffee bean roasting degree recognition, because in TSBC In the definition, it is necessary for the P k- th model to be classified into the k +1-th category for T consecutive times. At this time, it can be regarded as the k +1-th category. Therefore, the dashed box in the fifth category of the line chart, although the It is jumping in the 5th and 6th categories, but the number of the 6th category has not reached the continuous number threshold, so it is still in the 5th category. Compared with the convolutional neural network suitable for coffee bean roasting degree recognition, it has successfully solved the violation of the characteristics of roasted coffee beans, and correctly identified and classified the 8, 9, and 10 types of smoke in the video.

使用TSBC測試咖啡豆烘焙視訊的結果,因為本發明定義在TSBC中必須要第P k 個模型分類達連續T次的第k+1類,此時才算真正進入第k+1類,所以最後估測分類Agtron值為TSBC的最後辨識分類類別再轉換到對應的Agtron值,與第四章的辨識分類視訊最後一張影像有所不同。在使用TSBC估測差值評估方面,因為全都辨識分類正確,所以Agtron差值都為0。 Use TSBC to test the results of coffee roasting video, because the present invention defines that in TSBC, the P k- th model must be classified to the k+1-th consecutive T times, and then it is considered to be the k+1-th category, so finally The estimated classification Agtron value is TSBC's final identification classification category and then converted to the corresponding Agtron value, which is different from the last image of the identification classification video in Chapter 4. In terms of using TSBC to estimate the difference evaluation, because all the identification and classification are correct, the Agtron difference is 0.

綜合以上所述,可以獲得如下結論:本發明係採用一般彩色攝影機的可見光顏色配合卷積神經網路即時估測咖啡烘焙中最權威之指標Agtron烘焙度,因為Agtron烘焙度與彩色資訊高度相關,所以調整一般的卷積神經網路架構及參數發展出「適用於咖啡豆烘焙度辨識的卷積神經網路」,但是會因其他因素(例如:煙霧)而辨識能力不足,所以根據烘焙咖啡豆的特性,發展出時間順序二元分類模型(TSBC),而最終得到了滿意的結果,並且也符合我們所預期能夠提供即時傳送烘焙度給烘焙者,以減輕專業烘焙師工作量,以及讓一般業餘烘焙者也可烘焙出專業級的咖啡豆。 Based on the above, the following conclusions can be drawn: The present invention uses the visible light color of a general color camera and a convolutional neural network to estimate in real time the most authoritative indicator Agtron roasting degree in coffee roasting, because Agtron roasting degree is highly correlated with color information. Therefore, the general convolutional neural network structure and parameters are adjusted to develop a "convolutional neural network suitable for coffee bean roasting degree recognition", but the recognition ability is insufficient due to other factors (such as smoke), so according to roasted coffee beans The characteristics of the chronological binary classification model (TSBC) was developed, and finally a satisfactory result was obtained, and it was also in line with our expectations. It can provide instant delivery of roasting degrees to roasters to reduce the workload of professional roasters and make general Amateur roasters can also roast professional coffee beans.

Claims (6)

一種咖啡豆烘焙度即時估測方法,得包含下述步驟:一取得咖啡生豆資訊步驟,得包含產地、品種、季節,含水量等咖啡生豆相關資訊,並作成一樣品烘培度影像資料庫,供即時估測模型訓練及測試之用;一進行烘培步驟,係以攝影機,配合照明,取得烘培中咖啡豆視訊或影像,同時以各種感測器取得並記錄咖啡烘培資訊,其得包含室溫、爐內溫度、烘培時間、烘培時的聲音、氣體成份分析等,做為即時估測模型訓練及測試之用;一演算法步驟,係將該視訊或影像與樣品烘培度影像進行比對,且以一演算法配合即時估測模型即時估測咖啡烘培度,得據以作記錄、顯示或控制咖啡烘培機的烘培作業,直至烘培結束;其中該演算法步驟係基於時間順序二元分類法,其包含下述步驟:一咖啡豆烘焙度設定步驟,係在適用咖啡豆烘焙分類的一時間順序二元分類模型選用一烘焙度分類;一攝錄影步驟,係對烘培過程中的咖啡豆進行攝錄影;一影像擷取步驟,係以ROI擷取方式進行即時擷取該錄影成影像,其中擷取出僅含咖啡豆的50x50區塊;及一估測步驟,係輸入擷取影像於該時間順序二元分類模型,以進行 烘焙度估測演算程序;藉由上述步驟,若咖啡豆的烘焙過程中達到所設定烘焙度分類,則進行停止烘焙並下豆冷卻;其中該時間順序二元分類模型進行烘焙度估測演算步驟:步驟(1):設定該時間順序二元分類模型的起始參數設定:二元模型計數器k=1、連續次數的門檻值T=4,連續次數計數器t=0,預定烘焙度分類I;步驟(2):切換至P k 二元模型以辨識第k及k+1類;步驟(3):輸入下一個畫面至P k 做分類;步驟(4):分類的結果是否為第k+1類?如果是則t=t+1,如果否,則t=0,並回到上述步驟(3);步驟(5):是否t=T?,如果是,則進入下個步驟(6),如果否,則進入上述步驟(3);及步驟(6):是否k+1=I?如果是,則宣告"已達預定烘焙度第I分類"並結束演算法,如果否,則i=k+1,宣告現在進入第i類烘焙度,回到上述步驟(2)。 A method for real-time coffee bean roasting degree estimation includes the following steps: a step of obtaining green coffee bean information, which includes the origin, variety, season, and water content of the green coffee beans, and forming a sample roasting degree image data The library is used for real-time estimation model training and testing; for the roasting step, a camera and lighting are used to obtain video or images of roasting coffee beans. At the same time, various sensors are used to obtain and record coffee roasting information. It should include room temperature, furnace temperature, baking time, sound during baking, gas composition analysis, etc., for real-time estimation model training and testing; an algorithm step is to combine the video or image with the sample The roasting degree images are compared, and the coffee roasting degree is estimated in real time with an algorithm and real-time estimation model, which can be used to record, display or control the roasting operation of the coffee roaster until the roasting is completed; The algorithm steps are based on the chronological binary classification method, which includes the following steps: a coffee bean roasting degree setting step is to select a roasting degree classification in a time sequential binary classification model suitable for coffee bean roasting classification; The video step is to take a video of the coffee beans during the roasting process; an image capture step is to capture the video into an image in real time by way of ROI capture, in which a 50x50 block containing only coffee beans is captured And an estimation step, which is to input the captured images in the chronological binary classification model to perform the roasting degree estimation calculation procedure; through the above steps, if the coffee beans reach the set roasting degree classification during the roasting process, then The roasting is stopped and the beans are cooled down; wherein the time sequence binary classification model performs roasting degree estimation calculation steps: Step (1): Set the initial parameter setting of the time sequence binary classification model: binary model counter k=1 , The threshold value of consecutive times T=4, the consecutive times counter t=0, the predetermined baking degree classification I; Step (2): switch to the P k binary model to identify the k and k +1 categories; Step (3): Enter the next screen to P k for classification; Step (4): Is the classification result of the k+1 category? If yes, then t = t +1, if not, then t =0, and go back to the above step (3); Step (5): Is t=T? , If yes, go to the next step (6), if not, go to the above step (3); and step (6): whether k+1=I? If it is, it declares "has reached the first category of the predetermined baking degree" and ends the algorithm. If not, then i=k+1, it is declared that it has entered the i-th type of baking degree, and the above step (2) is returned. 如請求項1所述咖啡豆烘焙度即時估測方法,其中該時間順序二元分類模型的輸入為第k類影像訓練集BA,而輸出則為P k 二元模型,又該P k 二元模型的訓練步驟如下述:步驟(1):取RGB訓練影像集BA中屬於第k類以及第k+1類訓練影像集;步驟(2):將取出影像分訓練及驗證;步驟(3):開始訓練。 The method for real-time coffee bean roasting degree estimation according to claim 1, wherein the input of the chronological binary classification model is the k-th image training set BA, and the output is the P k binary model, and the P k binary classification model The training steps of the model are as follows: Step (1): Take the k-th and k+1-th training image sets from the RGB training image set BA; Step (2): Train and verify the taken images; Step (3) : Start training. 如請求項2所述咖啡豆烘焙度即時估測方法,其中該第k類影像訓練集BA的製作方式係更包含有:步驟(1):製作訓練影像B TIB(Training Images(Baking));步驟(2):增加訓練集影像數量,形成訓練影像TIBA(Training Images(Baking)(augmentation)),即將前述步驟(1)取得之第K類烘焙度訓練影像集BA為基礎,採用資料增強(data augmentation)技術以增加訓練影像集數量。 The method for real-time coffee bean roasting degree estimation according to claim 2, wherein the method for making the k-th image training set BA further includes: Step (1): making training image B TIB (Training Images (Baking)); Step (2): Increase the number of images in the training set to form training images TIBA (Training Images (Baking) (augmentation)), that is, the K-th type of baking training image obtained in the previous step (1) Based on the BA, data augmentation technology is used to increase the number of training image sets. 如請求項1所述咖啡豆烘焙度即時估測方法,其中除攝影機外,得以其他各種感測器取得咖啡烘培中資訊作為輸入,以取得並記錄咖啡烘培資訊,其包含室溫、爐內溫度、烘培時間、烘培時的聲音、氣體成份分析之資料,以提供烘培師(人或機器)充分即時掌握烘培狀況,得到所要的最佳烘培品質。 The method for real-time coffee roasting degree estimation as described in claim 1, in which, in addition to the camera, other sensors can obtain the coffee roasting information as input to obtain and record the coffee roasting information, including room temperature, oven The internal temperature, baking time, sound during baking, and gas composition analysis data provide the baker (man or machine) to fully understand the baking conditions in real time and obtain the best baking quality required. 一種咖啡豆烘焙度即時估測方法,得包含下述步驟:一取得咖啡生豆資訊步驟,得包含產地、品種、季節,含水量等咖啡生豆相關資訊,並作成一樣品烘培度影像資料庫,供即時估測模型訓練及測試之用;一進行烘培步驟,係以攝影機,配合照明,取得烘培中咖啡豆視訊或影像,同時以各種感測器取得並記錄咖啡烘培資訊,其得包含室溫、爐內溫度、烘培時間、烘培時的聲音、氣體成份分析等,做為即時估測模型訓練及測試之用; 一演算法步驟,係將該視訊或影像與樣品烘培度影像進行比對,且以一演算法配合即時估測模型即時估測咖啡烘培度,得據以作記錄、顯示或控制咖啡烘培機的烘培作業,直至烘培結束;其中該演算法步驟係基於卷積神經網路法,其包含下述步驟:一咖啡豆烘焙度設定步驟,係在適用咖啡豆烘焙分類的一卷積神經網路模型選用一烘焙度分類;一攝錄影步驟,係對烘培過程中的咖啡豆進行攝錄影;一影像擷取步驟,係以ROI擷取方式進行即時擷取該錄影成影像,其中擷取出僅含咖啡豆的50x50區塊;及一估測步驟,係將所擷取影像與該卷積神經網路模型所選用的烘焙度分類兩者進行估測;藉由上述步驟,若咖啡豆的烘焙過程中達到所設定烘焙度分類,則進行停止烘焙並下豆冷卻;其中所使用該卷積神經網路模型係更包含下述:步驟(1)入已烘培製作完成的樣本咖啡豆;步驟(2)進行第K類樣本咖啡豆不加熱烘培;步驟(3)錄製第K類樣本咖啡豆烘培視訊;步驟(4)製作RGB影像集;步驟(5)卷積神經網路訓練及參數調整;其中所使用卷積神經網路訓練及參數調整係更包含下述:步驟(1)參考CNN模型;步驟(2)修改CNN模型的FEP參數;步驟(3)輸入該RGB影像集開始訓練;步驟(4)測試並決定最佳參數;又其中該FEP參 數係告包含有卷積層卷積核的大小、激勵函數、池化層的濾波器大小及其步驟、咖啡烘焙度的色彩空間;前述所使用樣本咖啡豆係設為對應Agtron值的10類樣本咖啡豆。 A method for real-time coffee bean roasting degree estimation includes the following steps: a step of obtaining green coffee bean information, which includes the origin, variety, season, and water content of the green coffee beans, and forming a sample roasting degree image data The library is used for real-time estimation model training and testing; for the roasting step, a camera and lighting are used to obtain video or images of roasting coffee beans. At the same time, various sensors are used to obtain and record coffee roasting information. It should include room temperature, furnace temperature, baking time, sound during baking, gas composition analysis, etc., for real-time estimation model training and testing; An algorithm step is to compare the video or image with the sample roasting degree image, and use an algorithm to cooperate with the real-time estimation model to estimate the coffee roasting degree in real time, which can be used to record, display or control coffee roasting The roasting operation of the roasting machine until the roasting ends; the algorithm step is based on the convolutional neural network method, which includes the following steps: a coffee bean roasting degree setting step is applied to a roll of coffee beans roasting classification The product neural network model uses a roasting degree classification; a video recording step is to record the coffee beans in the roasting process; an image capturing step is to capture the video in real time by ROI capture An image in which a 50x50 block containing only coffee beans is extracted; and an estimation step is to estimate both the captured image and the roasting degree selected by the convolutional neural network model; by the above steps If the coffee beans reach the set roasting degree classification during the roasting process, the roasting will be stopped and the beans will be cooled down; the convolutional neural network model used further includes the following: step (1) the roasting is completed Sample coffee beans; step (2) roasting type K sample coffee beans without heating; step (3) recording the roasting video of type K sample coffee beans; step (4) making RGB image collection; step (5) volume Convolutional neural network training and parameter adjustment; the used convolutional neural network training and parameter adjustment system further includes the following: step (1) refer to the CNN model; step (2) modify the FEP parameters of the CNN model; step (3) Input the RGB image set to start training; step (4) test and determine the best parameters; and the FEP parameter The number system report includes the size of the convolution kernel of the convolution layer, the excitation function, the filter size of the pooling layer and its steps, and the color space of the coffee roasting degree; the aforementioned sample coffee beans are set to 10 types of samples corresponding to the Agtron value Coffee beans. 如請求項5所述咖啡豆烘焙度即時估測方法,其中除攝影機外,得以其他各種感測器取得咖啡烘培中資訊作為輸入,以取得並記錄咖啡烘培資訊,其包含室溫、爐內溫度、烘培時間、烘培時的聲音、氣體成份分析之資料,以提供烘培師(人或機器)充分即時掌握烘培狀況,得到所要的最佳烘培品質。 As described in claim 5, the coffee bean roasting degree real-time estimation method, in which, in addition to the camera, other sensors can obtain the coffee roasting information as input to obtain and record the coffee roasting information, including room temperature, oven The internal temperature, baking time, sound during baking, and gas composition analysis data provide the baker (man or machine) to fully understand the baking conditions in real time and obtain the best baking quality required.
TW108101000A 2019-01-10 2019-01-10 Method for real-time estimation of coffee bean agtron baking level TWI708194B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
TW108101000A TWI708194B (en) 2019-01-10 2019-01-10 Method for real-time estimation of coffee bean agtron baking level

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
TW108101000A TWI708194B (en) 2019-01-10 2019-01-10 Method for real-time estimation of coffee bean agtron baking level

Publications (2)

Publication Number Publication Date
TW202026957A TW202026957A (en) 2020-07-16
TWI708194B true TWI708194B (en) 2020-10-21

Family

ID=73004899

Family Applications (1)

Application Number Title Priority Date Filing Date
TW108101000A TWI708194B (en) 2019-01-10 2019-01-10 Method for real-time estimation of coffee bean agtron baking level

Country Status (1)

Country Link
TW (1) TWI708194B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TWI777494B (en) * 2021-04-15 2022-09-11 木時股份有限公司 Baking system using weight loss ratio and color to control baking range

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TWI770987B (en) * 2021-05-05 2022-07-11 國立暨南國際大學 Coffee automatic roasting device and method thereof

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090220645A1 (en) * 2008-02-25 2009-09-03 Luis Federico Martinez Quality Enhancement of Coffee Beans by Acid and Enzyme Treatment
TW201136537A (en) * 2010-04-26 2011-11-01 Guo-Min Chen Coffee bean roasting method and apparatus thereof
TW201404315A (en) * 2012-07-18 2014-02-01 Yung-Chang Lin Intelligent roasting apparatus
US20160120211A1 (en) * 2014-11-04 2016-05-05 Board Of Regents, The University Of Texas System Method and Apparatus for Controlling Coffee Bean Roasting
US20160174590A1 (en) * 2012-09-15 2016-06-23 Deepak Boggavarapu Systems and methods for coffee preparation
CN106579488A (en) * 2016-11-24 2017-04-26 周南 Coffee baking device capable of monitoring baking degree in real time and monitoring method

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090220645A1 (en) * 2008-02-25 2009-09-03 Luis Federico Martinez Quality Enhancement of Coffee Beans by Acid and Enzyme Treatment
TW201136537A (en) * 2010-04-26 2011-11-01 Guo-Min Chen Coffee bean roasting method and apparatus thereof
TW201404315A (en) * 2012-07-18 2014-02-01 Yung-Chang Lin Intelligent roasting apparatus
US20160174590A1 (en) * 2012-09-15 2016-06-23 Deepak Boggavarapu Systems and methods for coffee preparation
US20160120211A1 (en) * 2014-11-04 2016-05-05 Board Of Regents, The University Of Texas System Method and Apparatus for Controlling Coffee Bean Roasting
CN106579488A (en) * 2016-11-24 2017-04-26 周南 Coffee baking device capable of monitoring baking degree in real time and monitoring method

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TWI777494B (en) * 2021-04-15 2022-09-11 木時股份有限公司 Baking system using weight loss ratio and color to control baking range

Also Published As

Publication number Publication date
TW202026957A (en) 2020-07-16

Similar Documents

Publication Publication Date Title
TWI708194B (en) Method for real-time estimation of coffee bean agtron baking level
CN106920229A (en) Image obscuring area automatic testing method and system
KR102449841B1 (en) Method and apparatus for detecting target
Huang et al. Real-time classification of green coffee beans by using a convolutional neural network
CN109044322A (en) A kind of contactless heart rate variability measurement method
JP2016109495A (en) Classifier generation device, appearance inspection device, classifier generation method, and program
TWI684924B (en) Assisting appatatus for bean roasting and bean roasting appatatus
CN106204779A (en) The check class attendance method learnt based on plurality of human faces data collection strategy and the degree of depth
CN110298231A (en) A kind of method and system determined for the goal of Basketball Match video
WO2016206344A1 (en) White balance correction method, device and computer storage medium
JP6447865B2 (en) Freshness determination method using digital camera image data
CN110123149A (en) A kind of cooking control method and cooking equipment of cooking equipment
CN104065872B (en) Moving image extraction element, moving image extracting method and recording medium
CN104463216B (en) Eye movement mode data automatic obtaining method based on computer vision
CN113706507B (en) Real-time rope skipping counting method, device and equipment based on human body posture detection
WO2017193796A1 (en) Photographing processing method and apparatus for smartwatch
CN112056945A (en) Method for reminding food cooking state of cooking equipment
TWM532167U (en) Automatic roast-monitoring device
CN112084851A (en) Hand hygiene effect detection method, device, equipment and medium
CN114494941A (en) Comparison learning-based weak supervision time sequence action positioning method
CN108257117B (en) Image exposure evaluation method and device
CN104568639B (en) A kind of determination method and apparatus of sugar degree
CN112613520A (en) Pu-erh raw tea, old tea and ripe tea judging method based on convolutional neural network
Yin et al. Automatic retinal interest evaluation system (ARIES)
CN114831501A (en) Method for acquiring surface maturity curve of food material and intelligent cooking appliance thereof