Coffee bean producing area tracing method based on detection temperature optimization
By optimizing the temperature detection and machine learning model, the problems of large equipment, complex operation, and high cost in existing technologies have been solved, enabling rapid and accurate traceability of coffee bean origins, reducing operational complexity and cost, and improving the applicability and accuracy of the traceability model.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- ZHEJIANG FORESTRY UNIVERSITY
- Filing Date
- 2026-01-20
- Publication Date
- 2026-05-08
AI Technical Summary
Existing methods for tracing the origin of coffee beans suffer from problems such as large equipment size, complex operation, long testing cycle, and high cost, making it difficult to achieve low-cost, rapid, and standardized traceability.
By obtaining coffee bean samples from different origins, preparing coffee solutions and mixing them with NaOH solutions, analyzing the optimal detection temperature, recording peak currents using cyclic voltammetry, calculating relative current gain, optimizing the global optimal temperature, and combining machine learning models for source tracing.
It enables rapid and accurate traceability of coffee bean origin, is simple to operate, low in cost, and improves the universality and classification accuracy of the traceability model.
Smart Images

Figure CN121995018A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of food traceability technology, and in particular to a method for tracing the origin of coffee beans based on temperature-optimized detection. Background Technology
[0002] The origin of coffee beans is a key factor influencing their quality and value. Differences in environmental conditions such as climate, soil, and altitude between different origins lead to significant variations in flavor and composition. Currently, methods for tracing the origin of coffee beans mainly include sensory evaluation, spectroscopic analysis, chromatographic analysis, and mass spectrometry. Sensory evaluation relies on the experience of professional tasters, is highly subjective, has poor repeatability, and is difficult to standardize for traceability. While spectroscopic analysis, chromatographic analysis, and mass spectrometry offer high detection accuracy, they suffer from drawbacks such as bulky equipment, complex operation, long testing cycles, and high costs, failing to meet the demand for low-cost, rapid traceability. Summary of the Invention
[0003] To address the aforementioned technical problems, this invention provides a method for tracing the origin of coffee beans based on temperature detection optimization. This method enables rapid and accurate traceability of coffee bean origins, is simple to operate, and is inexpensive.
[0004] To solve the above problems, the present invention adopts the following technical solution: The present invention provides a method for tracing the origin of coffee beans based on temperature detection optimization, comprising the following steps: S1: Obtain coffee bean samples from different origins, prepare m samples of coffee beans from each origin, and prepare a coffee solution corresponding to each coffee bean sample; S2: Mix each coffee solution with NaOH solution to obtain the corresponding mixed solution, analyze the optimal detection temperature of each mixed solution, and take the average of the optimal detection temperatures of all mixed solutions as the global optimal temperature; S3: Mix the coffee solution corresponding to each coffee bean sample with NaOH solution evenly to obtain the corresponding mixed solution. Adjust the temperature of the mixed solution to the global optimal temperature and extract the corresponding feature signal set. S4: Input the feature signal set and origin label of coffee bean sample into the machine learning model for training to obtain the coffee bean origin traceability model; S5: Prepare the coffee solution corresponding to the coffee bean sample to be tested, and mix it evenly with NaOH solution to obtain a mixed solution. Adjust the temperature of the mixed solution to the global optimal temperature, extract the corresponding feature signal set, input the feature signal set into the coffee bean origin traceability model, and the coffee bean origin traceability model outputs the origin of the coffee bean sample to be tested.
[0005] Preferably, the method for analyzing the optimal detection temperature of the mixed solution in step S2 includes the following steps: M1: Place the three-electrode sensor in the mixed solution and adjust the temperature of the mixed solution to... Let k=0, The preset starting temperature; M2: Cyclic voltammetry curves of the mixed solution were obtained using cyclic voltammetry. Record the cyclic voltammetry curve peak current ; M3: Raise the temperature of the mixed solution to... , , Cyclic voltammetry was used to collect cyclic voltammetric curves of the mixed solution, with the temperature step being [value missing]. Record the cyclic voltammetry curve peak current ; M4: Calculate the relative current gain rate The calculation formula is: ; M5: Determine the relative current gain rate Is it less than or equal to the preset gain threshold? If so, then set the temperature. If the optimal detection temperature for the mixed solution is reached, the process ends; otherwise, proceed to step M6. M6: Temperature Measurement Is it less than the termination temperature? If so, let k = k + 1 and jump to step M3; otherwise, terminate at temperature. The optimal detection temperature for this mixed solution is determined, and the process ends here.
[0006] , where a is a positive integer greater than 1.
[0007] Increased temperature accelerates the mass transfer rate of electroactive substances and electrode reaction kinetics in the mixed solution, leading to an increase in response current and thus improving detection sensitivity. However, the increase in current is not linearly related to temperature. Initially, the current gain is significant, but as the temperature reaches a certain level, the relative current gain due to temperature increases gradually decreases.
[0008] This method first adjusts the temperature of the mixed solution to a preset starting temperature, so as to... The temperature is increased in increments of a certain step, and the peak current at each temperature is detected. The relative current gain is calculated, and when the relative current gain is... ≤ When the current increase reaches a plateau, it means that further heating will no longer significantly enhance the signal. At this point, the detection system is already in its high-sensitivity range, and further heating will only result in minimal sensitivity improvement while continuously increasing energy consumption, requiring higher temperature costs. Furthermore, high temperatures will accelerate electrode corrosion, damaging equipment lifespan and detection stability. Therefore, heating should be stopped, and the current temperature should be maintained. The optimal detection temperature for this mixed solution; If the temperature of the mixed solution is raised to equal to or greater than the termination temperature At that time, the relative current gain rate still did not appear. ≤ The termination temperature will be set. The optimal detection temperature for this mixed solution is set at a preset termination temperature to avoid problems such as rapid electrode corrosion, drastic increase in energy consumption, and changes in the electrochemical properties of coffee components due to high temperatures. Exceeding the termination temperature will break through the limits of equipment tolerance and detection economy, leading to unsustainable detection.
[0009] The optimal detection temperature for each mixed solution is determined using the method described above. The average of these optimal detection temperatures across all mixed solutions is then taken as the global optimal temperature. This method calculates a global optimal temperature that balances detection sensitivity, energy consumption cost, and detection stability.
[0010] Preferably, the starting temperature The temperature step is 20℃~25℃. The termination temperature is 2℃ to 5℃. The temperature ranges from 60℃ to 80℃.
[0011] Preferably, the gain threshold The value range is 4% to 8%.
[0012] Preferably, in step S2, the average of the optimal detection temperatures of all mixed solutions is used as the global optimal temperature calculation formula as follows: , in, The optimal temperature is denoted by n, where n is the number of coffee bean producing regions. Let be the optimal detection temperature for the mixed solution corresponding to the j-th coffee bean sample from the i-th origin, where 1 ≤ i ≤ n and 1 ≤ j ≤ m.
[0013] As a preferred method, the method for extracting the feature signal set corresponding to the coffee bean sample includes the following steps: N1: Place the three-electrode sensor in the mixed solution corresponding to the coffee bean sample, which has been adjusted to the global optimal temperature; N2: A v μL sample of coffee bean solution is added to the mixed solution every t seconds, for a total of g drops. The response current of the mixed solution is collected using a chronoamperometry method, and the average response current within t seconds after each addition of coffee solution is recorded. The average response current within t seconds after the qth addition of coffee solution is... , 1≤q≤g; N3: The set of characteristic signals for this coffee bean sample is composed of all the recorded average response currents.
[0014] Preferably, t is 20~100, v is 50~100, and g is 5~20.
[0015] As a preferred method, the method for preparing the coffee solution corresponding to the coffee bean sample includes the following steps: grinding the coffee bean sample and passing it through an 80-100 mesh sieve, dissolving it in distilled water at 95°C at a solid-liquid ratio of 1:10 (g / mL), stirring evenly, and then allowing it to stand and filter to obtain the coffee solution.
[0016] As a preferred method, the coffee solution and NaOH solution are uniformly mixed to obtain the corresponding mixed solution as follows: 1 mL of coffee solution is uniformly mixed with 20 mL of 0.05 mol / L NaOH solution to obtain the corresponding mixed solution.
[0017] Preferably, the machine learning model is a random forest model.
[0018] The beneficial effects of this invention are: (1) It can quickly and accurately trace the origin of coffee beans, and the operation is simple and the cost is low. (2) By introducing relative current gain rate to optimize the temperature, a smart balance can be achieved between the current enhancement effect and the temperature cost. (3) The global optimal temperature integrates the electrochemical characteristics of each origin, which can better ensure that coffee from all origins is in the high sensitivity range during detection, thereby improving the universality and classification accuracy of the traceability model. Attached Figure Description
[0019] Figure 1 This is a flowchart of an embodiment. Detailed Implementation
[0020] The technical solution of the present invention will be further described in detail below through embodiments and in conjunction with the accompanying drawings.
[0021] Example: This example illustrates a method for tracing the origin of coffee beans based on temperature detection optimization. Figure 1 As shown, it includes the following steps: S1: Obtain coffee bean samples from different origins. Prepare m samples of coffee beans from each origin, where m > 1. Prepare a coffee solution corresponding to each coffee bean sample.
[0022] The method for preparing a coffee solution corresponding to a coffee bean sample includes the following steps: after grinding the coffee bean sample, pass it through an 80-100 mesh sieve, dissolve it in distilled water at 95℃ at a solid-liquid ratio of 1:10 (g / mL), stir evenly, let it stand and filter to obtain a coffee solution.
[0023] S2: Mix each coffee solution with NaOH solution to obtain the corresponding mixed solution. Analyze the optimal detection temperature of each mixed solution and take the average of the optimal detection temperatures of all mixed solutions as the global optimal temperature.
[0024] The method for analyzing the optimal detection temperature of a mixed solution includes the following steps: M1: Place the three-electrode sensor in the mixed solution and adjust the temperature of the mixed solution to... Let k=0, The preset starting temperature; M2: Cyclic voltammetry curves of the mixed solution were obtained using cyclic voltammetry. Record the cyclic voltammetry curve peak current ; M3: Raise the temperature of the mixed solution to... , , Cyclic voltammetry was used to collect cyclic voltammetric curves of the mixed solution, with the temperature step being [value missing]. Record the cyclic voltammetry curve peak current ; M4: Calculate the relative current gain rate The calculation formula is: ; M5: Determine the relative current gain rate Is it less than or equal to the preset gain threshold? If so, then set the temperature. If the optimal detection temperature for the mixed solution is reached, the process ends; otherwise, proceed to step M6. M6: Temperature Measurement Is it less than the termination temperature? If so, let k = k + 1 and jump to step M3; otherwise, terminate at temperature. The optimal detection temperature for this mixed solution is determined, and the process ends here. , where a is a positive integer greater than 1.
[0025] The parameters for cyclic voltammetry are: potential range -0.9 to -0.2 V, scan rate 10–100 mV / s, and 2 scan cycles. Cyclic voltammetry provides rich redox information and is suitable for studying the effect of temperature on electrochemical behavior.
[0026] Starting temperature The temperature range is 20℃ to 25℃, with a temperature step size of [missing information]. The temperature range is 2℃~5℃, and the termination temperature is... Gain threshold: 60℃~80℃ The value range is 4% to 8%. In this embodiment, the initial temperature... The temperature step size is 20℃. The termination temperature is 5℃. 60℃, gain threshold The value is 5%.
[0027] The average of the optimal detection temperatures of all mixed solutions is used as the formula for calculating the global optimal temperature, as follows: , in, The optimal temperature is denoted by n, where n is the number of coffee bean producing regions. Let be the optimal detection temperature for the mixed solution corresponding to the j-th coffee bean sample from the i-th origin, where 1 ≤ i ≤ n and 1 ≤ j ≤ m.
[0028] S3: Mix the coffee solution corresponding to each coffee bean sample with the NaOH solution to obtain the corresponding mixed solution. Adjust the temperature of the mixed solution to the global optimal temperature and extract the corresponding feature signal set.
[0029] The method for extracting the feature signal set corresponding to a coffee bean sample includes the following steps: N1: Place the three-electrode sensor in the mixed solution corresponding to the coffee bean sample, which has been adjusted to the global optimal temperature; N2: A v μL sample of coffee bean solution is added to the mixed solution every t seconds, for a total of g drops. The response current of the mixed solution is collected using a chronoamperometry method, and the average response current within t seconds after each addition of coffee solution is recorded. The average response current within t seconds after the qth addition of coffee solution is... , 1≤q≤g; N3: The characteristic signal set of this coffee bean sample is composed of all the recorded average response currents. .
[0030] Step N2 includes the following steps: N21: Let q=1, and add v μL of coffee bean sample corresponding to coffee solution to the mixed solution once; N22: The average response current of the mixed solution within t seconds was collected using the chronoamperometry method; N23: Determine if q is less than g. If yes, proceed to step N24; otherwise, end. N24: Let q = q + 1, add v μL of coffee bean sample corresponding to the coffee solution to the mixed solution once, and jump to step N22.
[0031] t is 20~100, v is 50~100, and g is 5~20. In this embodiment, t is 50, v is 50, and g is 20.
[0032] S4: Input the feature signal set and origin label of coffee bean samples into the machine learning model for training to obtain the coffee bean origin traceability model.
[0033] S5: Prepare the coffee solution corresponding to the coffee bean sample to be tested, and mix it evenly with NaOH solution to obtain a mixed solution. Adjust the temperature of the mixed solution to the global optimal temperature, extract the corresponding feature signal set, input the feature signal set into the coffee bean origin traceability model, and the coffee bean origin traceability model outputs the origin of the coffee bean sample to be tested.
[0034] The method for uniformly mixing coffee solution and NaOH solution to obtain the corresponding mixed solution is as follows: Mix 1 mL of coffee solution with 20 mL of 0.05 mol / L NaOH solution to obtain the corresponding mixed solution.
[0035] The three-electrode sensor consists of a nickel foam working electrode, a saturated KCl calomel reference electrode, and a platinum counter electrode. The nickel foam material has a three-dimensional network microporous structure, which can increase the contact area between the electrode and the solution to be tested, thereby improving the response current intensity.
[0036] In this scheme, firstly, a coffee solution corresponding to each coffee bean sample is prepared, and each coffee solution is uniformly mixed with NaOH solution to obtain a corresponding mixed solution. The optimal detection temperature for each mixed solution is then analyzed.
[0037] Increasing temperature accelerates the mass transfer rate and electrode reaction kinetics of electroactive substances in a homogeneous mixture of coffee and NaOH solutions, leading to an increase in response current and thus improving detection sensitivity. However, the increase in current is not linearly related to temperature. Initially, the current gain is significant, but as the temperature reaches a certain level, the relative current gain from the temperature increase gradually decreases.
[0038] This method first adjusts the temperature of the mixed solution to a preset starting temperature, so as to... The temperature is increased in increments of a certain step, and the peak current at each temperature is detected. The relative current gain is calculated, and when the relative current gain is... ≤ When the current increase reaches a plateau, it means that further heating will no longer significantly enhance the signal. At this point, the detection system is already in its high-sensitivity range, and further heating will only result in minimal sensitivity improvement while continuously increasing energy consumption, requiring higher temperature costs. Furthermore, high temperatures will accelerate electrode corrosion, damaging equipment lifespan and detection stability. Therefore, heating should be stopped, and the current temperature should be maintained. The optimal detection temperature for this mixed solution; If the temperature of the mixed solution is raised to equal to or greater than the termination temperature At that time, the relative current gain rate still did not appear. ≤ The termination temperature will be set. The optimal detection temperature for this mixed solution is set at a preset termination temperature to avoid problems such as rapid electrode corrosion, drastic increase in energy consumption, and changes in the electrochemical properties of coffee components due to high temperatures. Exceeding the termination temperature will break through the limits of equipment tolerance and detection economy, leading to unsustainable detection.
[0039] After analyzing the optimal detection temperature for each mixed solution using the above method, the average of the optimal detection temperatures for all mixed solutions is taken as the global optimal temperature. The global optimal temperature calculated by this method is a temperature point that takes into account detection sensitivity, energy consumption cost, and detection stability.
[0040] Next, the coffee solution corresponding to each coffee bean sample was uniformly mixed with NaOH solution and adjusted to the globally optimal temperature to extract the corresponding feature signal set. The chronoamperometry method was used for origin tracing, and the signal was stable, making it suitable for constructing reliable feature fingerprints.
[0041] Then, the feature signal set and origin label of the coffee bean sample are used as training samples to train the machine learning model to obtain the coffee bean origin traceability model. In this embodiment, the machine learning model is a random forest model.
[0042] Finally, the coffee bean sample to be tested is prepared into a corresponding coffee solution, which is then uniformly mixed with NaOH solution to obtain a mixed solution. The temperature of the mixed solution is adjusted to the global optimal temperature, and the corresponding feature signal set is extracted. The feature signal set is input into the coffee bean origin traceability model, and the coffee bean origin traceability model outputs the origin of the coffee bean sample to be tested.
[0043] This invention enables rapid and accurate traceability of coffee bean origins, is simple to operate, and is cost-effective. By introducing relative current gain rate to optimize temperature, a smart balance is achieved between the current enhancement effect and temperature cost. The globally optimal temperature integrates the electrochemical characteristics of various origins, ensuring that coffee from all origins is detected within a high-sensitivity range, thus improving the universality and classification accuracy of the traceability model.
Claims
1. A method for tracing the origin of coffee beans based on temperature detection optimization, characterized in that, Includes the following steps: S1: Obtain coffee bean samples from different origins, prepare m samples of coffee beans from each origin, and prepare a coffee solution corresponding to each coffee bean sample; S2: Mix each coffee solution with NaOH solution to obtain the corresponding mixed solution, analyze the optimal detection temperature of each mixed solution, and take the average of the optimal detection temperatures of all mixed solutions as the global optimal temperature; S3: Mix the coffee solution corresponding to each coffee bean sample with NaOH solution evenly to obtain the corresponding mixed solution. Adjust the temperature of the mixed solution to the global optimal temperature and extract the corresponding feature signal set. S4: Input the feature signal set and origin label of coffee bean sample into the machine learning model for training to obtain the coffee bean origin traceability model; S5: Prepare the coffee solution corresponding to the coffee bean sample to be tested, and mix it evenly with NaOH solution to obtain a mixed solution. Adjust the temperature of the mixed solution to the global optimal temperature, extract the corresponding feature signal set, input the feature signal set into the coffee bean origin traceability model, and the coffee bean origin traceability model outputs the origin of the coffee bean sample to be tested.
2. The method for tracing the origin of coffee beans based on temperature detection optimization according to claim 1, characterized in that, The method for analyzing the optimal detection temperature of the mixed solution in step S2 includes the following steps: M1: Place the three-electrode sensor in the mixed solution and adjust the temperature of the mixed solution to... Let k=0, The preset starting temperature; M2: Cyclic voltammetry curves of the mixed solution were obtained using cyclic voltammetry. Record the cyclic voltammetry curve peak current ; M3: Raise the temperature of the mixed solution to... , , Cyclic voltammetry was used to collect cyclic voltammetric curves of the mixed solution, with the temperature step being [value missing]. Record the cyclic voltammetry curve peak current ; M4: Calculate the relative current gain rate The calculation formula is: ; M5: Determine the relative current gain rate Is it less than or equal to the preset gain threshold? If so, then set the temperature. If the optimal detection temperature for the mixed solution is reached, the process ends; otherwise, proceed to step M6. M6: Temperature Measurement Is it less than the termination temperature? If so, let k = k + 1 and jump to step M3; otherwise, terminate at temperature. The optimal detection temperature for this mixed solution is determined, and the process ends here.
3. The method for tracing the origin of coffee beans based on temperature detection optimization according to claim 2, characterized in that, The starting temperature The temperature step is 20℃~25℃. The termination temperature is 2℃ to 5℃. The temperature ranges from 60℃ to 80℃.
4. The method for tracing the origin of coffee beans based on temperature detection optimization according to claim 2, characterized in that, The gain threshold The value range is 4% to 8%.
5. The method for tracing the origin of coffee beans based on temperature detection optimization according to claim 1, characterized in that, In step S2, the average of the optimal detection temperatures of all mixed solutions is used as the global optimal temperature calculation formula, which is as follows: , in, The optimal temperature is denoted by n, where n is the number of coffee bean producing regions. Let be the optimal detection temperature for the mixed solution corresponding to the j-th coffee bean sample from the i-th origin, where 1 ≤ i ≤ n and 1 ≤ j ≤ m.
6. The method for tracing the origin of coffee beans based on temperature detection optimization according to claim 1, characterized in that, The method for extracting the feature signal set corresponding to a coffee bean sample includes the following steps: N1: Place the three-electrode sensor in the mixed solution corresponding to the coffee bean sample, which has been adjusted to the global optimal temperature; N2: A v μL sample of coffee bean solution is added to the mixed solution every t seconds, for a total of g drops. The response current of the mixed solution is collected using a chronoamperometry method, and the average response current within t seconds after each addition of coffee solution is recorded. The average response current within t seconds after the qth addition of coffee solution is... , 1≤q≤g; N3: The set of characteristic signals for this coffee bean sample is composed of all the recorded average response currents.
7. The method for tracing the origin of coffee beans based on temperature detection optimization according to claim 6, characterized in that, The value of t is 20~100, the value of v is 50~100, and the value of g is 5~20.
8. The method for tracing the origin of coffee beans based on temperature detection optimization according to claim 1, characterized in that, The method for preparing a coffee solution corresponding to a coffee bean sample includes the following steps: after grinding the coffee bean sample, pass it through an 80-100 mesh sieve, dissolve it in distilled water at 95℃ at a solid-liquid ratio of 1:10 (g / mL), stir evenly, let it stand and filter to obtain a coffee solution.
9. The method for tracing the origin of coffee beans based on temperature detection optimization according to claim 1, characterized in that, The method for uniformly mixing coffee solution and NaOH solution to obtain the corresponding mixed solution is as follows: Mix 1 mL of coffee solution with 20 mL of 0.05 mol / L NaOH solution to obtain the corresponding mixed solution.
10. The method for tracing the origin of coffee beans based on temperature detection optimization according to claim 1, characterized in that, The machine learning model is a random forest model.