Automatic detection method and system for measuring fatty acid value of rice
By constructing a standardized optical environment and real-time image analysis, combined with deep learning algorithm verification, the problem of misjudgment of titration endpoint caused by interference from the color and turbidity of the extract in the detection of fatty acid value of rice was solved, and high-accuracy and high-repeatability automatic detection was achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- COFCO SHAANXI QUALITY INSPECTION CENT CO LTD
- Filing Date
- 2026-01-22
- Publication Date
- 2026-05-12
AI Technical Summary
Existing rice fatty acid value testing equipment suffers from problems such as delayed or misjudged titration endpoint identification due to the varying background color and turbidity of rice extract, resulting in poor accuracy and repeatability.
A standardized optical environment is constructed using a light sensor. The light intensity is adjusted by driving the light source. A stable vortex flow field is generated by combining a magnetic stirrer. The titration process is monitored in real time. The titration endpoint is adaptively determined by using image edge detection and color difference value calculation. The titration results are verified by combining deep learning algorithms, thus realizing the automatic detection of fatty acid value of rice.
It improves the accuracy and repeatability of rice fatty acid value detection, enhances adaptability to different rice samples, reduces interference from external light and liquid inhomogeneity, and ensures the accuracy of test results.
Smart Images

Figure CN122017121A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the technical field of substance composition detection, specifically to an automatic detection method and system for determining the fatty acid value of rice. Background Technology
[0002] Paleic acid value is a core indicator for determining the aging degree and storage quality grade of rice. In the grain industry, accurate measurement of paddy fatty acid value is of paramount importance for ensuring grain quality and safety, and for the rational planning of grain storage and distribution. With the development of science and technology, the detection technology for paddy fatty acid value is also constantly improving. Accurate and efficient detection methods play an important role in promoting the healthy development of the grain industry.
[0003] In existing technologies, the determination of fatty acid values in rice typically relies on acid-base titration of rice extract. Traditional glass electrode potentiometric titration is automated, using a glass electrode to detect potential changes and thus determine the titration endpoint. In contrast, optical titration based on photoelectric colorimetry is relatively low-cost, utilizing photoelectric sensors to detect color changes in an indicator to determine the titration endpoint.
[0004] However, traditional glass electrode potentiometric titration has significant drawbacks. Its core electrode components are expensive and highly susceptible to contamination by lipids and proteins in rice extracts, leading to sluggish electrode response and shortened lifespan. Optical titration based on photoelectric colorimetry is greatly affected by the sample matrix in practical applications. Because the background color of rice extracts from different origins and storage years varies significantly and is often accompanied by varying degrees of turbidity, existing low-cost sensors struggle to distinguish between the indicator's color change signal and the sample's background interference. This results in serious misjudgments when using a fixed threshold to determine the titration endpoint, making it difficult to balance cost-effectiveness with high accuracy, leading to poor detection accuracy and repeatability. Summary of the Invention
[0005] To address the technical problem that existing low-cost automated testing equipment struggles to overcome the interference of varying background color and turbidity in rice extracts, leading to delayed or misjudged titration endpoint identification and consequently poor detection accuracy and repeatability, this application provides an automated detection method and system for determining the fatty acid value of rice.
[0006] In a first aspect, this application provides an automated detection method for determining the fatty acid value of rice, comprising: Identify the rice grains to be tested; generate weighing and extraction instructions for the rice grains to be tested, and control the weighing and extraction device to perform weighing, liquid addition, shaking, and filtration operations to generate the rice grain extract; collect samples of the rice grain extract. A standardized optical environment is constructed, and the light source drive is dynamically adjusted to stabilize the light intensity through feedback from a photosensor. For the rice extract sample to be tested, a magnetic stirrer is activated to generate a stable vortex flow field. Before starting the titration, the identification information of the rice extract sample to be tested is determined and associated with basic information. When starting the titration, the pulsed addition of the standard titration solution and the acquisition of the reaction solution image are performed simultaneously. Edge detection and liquid surface recognition are performed on the acquired image to extract the liquid region image. Convert the pixel data of the liquid region image to Lab or HSV color space and establish a background reference dataset; calculate the color difference between the current liquid region image frame and the background reference dataset in real time; Based on sliding window smoothing, a color difference value trend curve is established; the color difference value change rate is monitored and calculated to determine the peak value of the color difference value change rate. The titration endpoint is determined based on the color difference trend curve, the peak value of the color difference change rate, and the adaptive threshold, and the titration amount is determined accordingly. Based on the titration amount of the current rice extract sample and the basic information of the associated rice extract samples, the fatty acid value is automatically calculated.
[0007] By adopting the above scheme, the rice grains to be tested are identified and automatically weighed and extracted to obtain a precise and controllable rice extract sample; pre-titration testing preparation is performed to eliminate interference from changes in external light and liquid inhomogeneity; sample titration is performed to establish a precise correspondence between the titration amount and the image, eliminating irrelevant elements and interference; through image data analysis, the titration endpoint is determined and the titration amount is calculated to obtain the rice fatty acid value; the entire process of weighing, extraction, and titration of the rice grains to be tested is automated, thereby completing the automatic detection of rice fatty acid value determination and improving the accuracy and repeatability of the detection.
[0008] Preferred options also include: By adding a photoelectric sensor, the intensity of transmitted light and scattered light of the reaction solution during the titration process is monitored in real time, and the real-time turbidity of the reaction solution is quantified. Based on the quantified real-time turbidity of the reaction solution, the preprocessing parameters of the acquired image and the color difference calculation parameters converted to Lab or HSV color space are dynamically adjusted.
[0009] By adopting the above scheme, a photoelectric sensor is added to monitor the real-time turbidity of the reaction solution and dynamically adjust relevant parameters, thereby further eliminating the influence of liquid turbidity on color difference calculation and improving the accuracy of detection results.
[0010] Preferred options also include: When initiating titration, the adaptive titration based on reaction kinetics of the standard titration solution is selected to replace the pulsed titration of the standard titration solution; the adaptive titration based on reaction kinetics includes: A multi-stage titration strategy is set up, with different stages of titration strategy having corresponding preset titration speeds and single titration volumes. Each stage of titration strategy is also set with a preset range of color difference change rate. The larger the preset range of color difference change rate, the slower the titration speed and the smaller the single titration volume in the corresponding stage of titration strategy. The rate of change of color difference value fed back from the previous time step is obtained, and the range of the rate of change of color difference value fed back is determined to adaptively match the titration strategy in the subsequent time step to assist in the adaptive titration of the reaction kinetics of the standard titration solution.
[0011] By adopting the above scheme, a multi-stage titration strategy is designed, and the titration rate and single titration volume are adaptively adjusted according to reaction kinetics. This avoids the endpoint misjudgment caused by excessively fast titration or the detection efficiency caused by excessively slow titration, thereby improving the accuracy and efficiency of the titration process.
[0012] Preferred options also include: In the process of performing edge detection and liquid surface recognition on the acquired image to extract the liquid region image, fixed position RIO and dynamic RIO are defined; the dynamic RIO is set up around the vortex region by performing vortex detection on the acquired image, and selects the region with uniform texture as ROI by texture analysis and bubble and attachment detection, and removes the region with bubbles and attachment. Calculate the color difference between the liquid region image frame and the background reference dataset for each RIO region; establish a color difference trend curve for each RIO region and determine the peak value of the color difference change rate for each RIO region; determine the titration endpoint based on the color difference trend curve, peak value of the color difference change rate, and adaptive threshold for each RIO region, and record the determined titration endpoint for each RIO region as a candidate endpoint; check whether the titration endpoints for each ROI region are clustered within the allowable volume error range; if they are clustered within the allowable volume error range, select the median of the candidate endpoints as the final endpoint; otherwise, consider the mixing uneven or the interference too great, generate an extended mixing time prompt or issue a warning.
[0013] By adopting the above scheme, liquid area images corresponding to multiple RIO regions are extracted, image information is obtained more accurately, and interference such as bubbles and deposits is avoided. By calculating the color difference value of each RIO region, establishing trend curves, and determining the peak value of the color difference change rate, the determination results of each RIO region are used as candidate endpoints and checked to promptly detect uneven mixing or large interference, thereby improving the accuracy and reliability of titration endpoint determination.
[0014] Preferred options also include: Calculate and obtain the corresponding liquid region image pixel data conversion method based on the mean background color in the current background reference dataset and the real-time turbidity of the reaction solution; the liquid region image pixel data conversion method includes: converting the liquid region image pixel data to Lab color difference space if it matches the local mean value which is less than the first preset color mean value and the turbidity which is less than the first preset turbidity; converting the liquid region image pixel data to HSV color difference space if it matches the local mean value which is greater than the second preset color mean value and the turbidity which is greater than the second preset turbidity; and converting the liquid region image pixel data to a comprehensive color difference space if it matches the local mean value which is within the range of the first preset color mean value and the second preset color mean value and the turbidity which is within the range of the first preset turbidity and the second preset turbidity. The conversion to the comprehensive color difference space includes: converting to Lab color difference space and HSV color difference space, calculating the key components of each color space respectively, and weighted fusing to generate a comprehensive color difference value.
[0015] By adopting the above scheme, a suitable image pixel data conversion method is selected based on the mean background color and the real-time turbidity of the reaction solution. For rice extract samples with different background colors and turbidities, color difference information can be extracted more accurately, further improving the accuracy of titration endpoint determination and adaptability to different samples.
[0016] Preferred options also include: Using deep learning algorithms and a titration strategy, the color difference between the extracted liquid region image frame and the background reference dataset is predicted. Calculate the absolute difference between the actual color difference value and the predicted color difference value, and determine whether the absolute difference is greater than the preset absolute difference threshold; calculate the absolute difference between the rate of change of color difference values corresponding to adjacent titration points at the current time, and determine whether the absolute difference between the rate of change of color difference values is greater than the preset threshold for the rate of change of color difference values. If there is an absolute difference greater than the preset absolute difference threshold or the absolute difference is greater than the preset color difference change rate difference threshold, the color difference value calculation and verification process is initiated. The color difference value calculation and verification process includes: reselecting the extracted liquid area image, switching between Lab and HSV color spaces, adjusting the weighting of each component in the converted Lab or HSV values, and recalculating the color difference value.
[0017] By adopting the above scheme, deep learning algorithms are used in combination with titration strategies to predict color difference values. By comparing the difference between the actual and predicted color difference values or the difference in the rate of change of color difference values over multiple time periods, a verification process is initiated when the difference exceeds the corresponding preset threshold, so as to detect anomalies in the color difference value calculation in a timely manner and improve the accuracy of color difference value calculation.
[0018] Preferred options also include: The pulsed addition of the standard titration solution and the multi-view acquisition of the reaction solution images were selected to be performed simultaneously. After determining the endpoint for the reaction solution images acquired from each view, the titration amount corresponding to the current rice extract sample was obtained by clustering, and the titration amounts corresponding to discrete rice extract samples were removed.
[0019] By adopting the above scheme, in order to avoid errors caused by image acquisition failures, the final titration amount corresponding to the endpoint is determined for each image frame at each angle, and the final titration amount is determined by clustering correction.
[0020] Secondly, this application provides an automated detection system for determining the fatty acid value of rice, comprising: The rice extract sample collection module is used to identify the rice to be tested and generate weighing and extraction instructions for the rice to be tested, so as to control the weighing and extraction device to perform weighing, liquid addition, shaking and filtering operations of the rice to be tested, generate the rice extract to be tested, and collect the rice extract sample to be tested. The rice extract titration image acquisition module is used to construct a standardized optical environment. It dynamically adjusts the light source drive to stabilize the light intensity through feedback from a photosensor. For the rice extract sample to be tested, a magnetic stirrer is activated to generate a stable vortex flow field. Before starting the titration, the identification information of the rice extract sample to be tested is determined and associated with basic information. During titration, the pulsed addition of the standard titration solution and the acquisition of images of the reaction solution are performed simultaneously. Edge detection and liquid surface recognition are performed on the acquired images to extract liquid region images. The rice extract titration color difference extraction module is used to convert the pixel data of the liquid region image to Lab or HSV color space and establish a background reference dataset; and to calculate the color difference value between the current liquid region image frame and the background reference dataset in real time. The rice extract titration feature extraction module is used to establish a color difference value trend curve based on sliding window smoothing; monitor and calculate the color difference value change rate, and determine the peak value of the color difference value change rate. The rice extract titration quantity determination module is used to determine the titration endpoint and determine the titration quantity based on the color difference trend curve, the peak value of the color difference change rate, and the adaptive threshold. The fatty acid value calculation module for rice extract is used to automatically calculate the fatty acid value based on the titration amount of the current rice extract sample and the associated basic information of the rice extract sample.
[0021] By adopting the above scheme, on the basis of automatically collecting rice extract samples, titration preparation is carried out to ensure the stability of the titration environment and the correlation of data, realize the synchronization of titration and collection and the accurate extraction of images, effectively separate and calculate color change signals, enhance feature recognition capabilities, accurately determine the titration endpoint and calculate the titration amount, and then measure the fatty acid value of rice.
[0022] Thirdly, this application provides a computer-readable storage medium including a stored computer program, wherein the computer program, when running, controls the device where the computer-readable storage medium is located to perform the method described above.
[0023] Fourthly, this application provides a computer device, the computer device including a memory, a processor and a program stored in the memory and executable thereon, the program being executed by the processor to implement the steps of the method described above.
[0024] In summary, this application has the following beneficial effects: 1. Identify the rice grains to be tested and perform automatic sample weighing and extraction to obtain a precise and controllable rice extract sample for sample titration. Before sample titration, a standardized optical environment is constructed to improve light stability, a stable vortex flow field is generated to ensure uniform reaction, and sample information is correlated to ensure accurate calculation. Through image acquisition, color space conversion, color difference value and change rate calculation, dynamic monitoring and analysis of the titration process are achieved, and the titration endpoint is accurately determined based on this, the titration amount is determined, and the rice fatty acid value is calculated, thus completing the automatic detection of rice fatty acid value determination. 2. By adding photoelectric sensors, using reaction kinetics-adaptive dripping, multi-RIO region extraction and analysis, adaptive color space conversion method selection, and deep learning algorithm verification, the anti-interference ability and endpoint determination accuracy of different rice samples are further improved, and the accurate dry basis fatty acid value is automatically calculated. Attached Figure Description
[0025] Figure 1 This is a flowchart of the automatic detection method for determining the fatty acid value of rice as described in a specific embodiment; Figure 2 This is a schematic diagram illustrating the principle of the automatic detection method for determining the fatty acid value of rice as described in a specific embodiment. Figure 3 This is a schematic diagram of the automatic detection system for determining the fatty acid value of rice as described in a specific embodiment. Detailed Implementation
[0026] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0027] like Figure 1As shown in the figure, this application discloses an automatic detection method for determining the fatty acid value of rice. It employs strategies such as hardware collaborative control, real-time image analysis, and adaptive endpoint determination to achieve accurate automatic determination of the fatty acid value of rice. The implementation steps of this method are described in detail below.
[0028] S1. Based on hardware collaboration, the collection, titration, and acquisition of image data of the rice extract to be tested are performed synchronously.
[0029] like Figure 2 As shown, firstly, the rice to be tested is determined. Specifically, the position of each container holding the rice to be tested is tracked and determined in real time using a vision device and displayed on a visual interactive interface. The system receives the rice container selected by the user from the visual interactive interface, and based on the position of the rice container, the central controller (MCU or PLC) issues a pick-up command and a pre-processing command to control the robotic arm to pick up the rice container and pour the rice into the integrated rice dehulling, crushing, and screening device to complete the pre-processing. The pick-up container then receives the processed rice.
[0030] Next, the collection of the rice extract to be tested is completed. Using a central controller (MCU or PLC), after acquiring the processed rice to be tested, weighing and extraction instructions are generated for the rice to be tested, so as to control the weighing and extraction device to perform weighing, liquid addition, shaking and filtering operations of the rice to be tested, generate the rice extract to be tested, and extract the sample.
[0031] Specifically, the weighing and extraction device includes a weighing device (such as a weighing platform) and an extraction device (such as a robotic arm device, a filtration device, etc.), both of which are communicatively connected to a central controller (MCU or PLC). The process of generating the rice extract to be tested includes: using the central controller (MCU or PLC) to control the robotic arm device to automatically place the container of rice to be tested onto the weighing device, and receiving the weight value of the rice to be tested returned by the weighing device. Based on the rice weight-preparation solution reagent mapping table pre-stored in the central controller, the capacity of the preparation solution reagent is determined according to the current weight of the rice to be tested in the container, so as to control the robotic arm device to complete the extraction, addition, and container sealing operations of the prepared solution reagent. Through pre-set vibration parameters, such as: oscillation time of 30 minutes (precise timing by PLC), adjustable amplitude (to adapt to the amplitude of the container size), and maintaining a horizontal and uniform speed during oscillation, the robotic arm device is controlled to complete the oscillation operation according to the pre-set vibration parameters. The robotic arm is then controlled to place the vibrated liquid into the filtration device to obtain the filtered rice extract to be tested. A central controller (MCU or PLC) is used to control a robotic arm to collect a portion of rice extract as a rice extract sample for subsequent rice extract sample titration and testing.
[0032] Next, to reduce environmental interference during titration, pre-titration preparations were performed, including environmental initialization and light field calibration. A central controller (MCU or PLC) issued a command to automatically activate the constant-current driven LED frequencyless flash source. A photosensor monitored the light intensity in real time and fed back to the central controller. Based on the photosensor feedback, the central controller dynamically adjusted the LED drive current to stabilize the light intensity at a preset standard value, creating a stable optical environment to ensure environmental stability during subsequent image acquisition of the rice extract sample. Simultaneously, the central controller sent a start command to the magnetic stirrer, setting the rotation speed parameters to create a stable vortex flow field in the rice extract sample within the reaction vessel, ensuring reaction homogeneity and eliminating interference from external light variations and liquid inhomogeneities in subsequent measurements.
[0033] Then, the titration and data acquisition are triggered synchronously. Before starting the titration, the identification information of the rice extract sample to be tested is determined (e.g., the sample number 001, 002, etc. is read through a QR code scanner or other devices) and associated with basic information (e.g., sample mass, moisture content, sampling time, storage conditions, etc.) to help subsequent personnel clearly obtain the fatty acid values of the rice extract to be tested. When starting the titration, the central controller sends a pulse control signal to the precision peristaltic pump to control the amount of standard titration solution (e.g., 0.1 mol / L NaOH solution) added. A "pump-view synchronization" mechanism is adopted, that is, every time a titration pulse action is executed, the central controller immediately sends a trigger signal to the camera device to synchronously capture a real-time image frame, ensuring that each frame of the reaction solution image (the reaction solution of the rice extract to be tested with the standard titration solution added in the reaction vessel) corresponds precisely to a specific titration amount, thus establishing a mapping relationship between the titration amount and the reaction solution image.
[0034] Finally, the automatic locking and extraction of regions of interest (ROIs) in the acquired images is completed. After receiving the raw image frame, the image processing unit executes edge detection, liquid surface detection, spot detection, and morphological operations. Specifically, the edge detection algorithm automatically identifies the edge contours of the reaction vessel; the liquid surface detection algorithm automatically identifies the meniscus position of the liquid surface; the spot detection algorithm automatically identifies and removes reflective spots and bubbles generated during stirring; and morphological operations remove these interfering elements. Through the combination of these algorithms, the raw image sequence is digitally cleaned, extracting pure liquid region images, avoiding manual selection of analysis areas, and improving the objectivity and consistency of the analysis.
[0035] S2. For the extracted liquid region image, perform dimensional transformation of the color space and substrate separation, and perform relative color difference analysis.
[0036] First, to eliminate background color interference, a color space conversion of the liquid region image is performed. The extracted liquid region image (RIO region) undergoes color space conversion, mapping the raw RGB data in real time to a more uniform color space that better matches human visual perception. Specifically, this process involves calculating the average RGB value of all pixels within the ROI region, and then applying a color space conversion matrix to convert the RGB values to the three components of the Lab color space (L (luminance), a (red-green axis), and b (yellow-blue axis), or to the three components of the HSV color space (H (hue), S (saturation), and V (value)). This conversion decomposes the color signal into independent luminance and chromaticity components, allowing subsequent analysis to handle different color attributes separately. Considering the color-changing characteristics of acid-base indicators (such as phenolphthalein), the focus is on the a component (Lab space) or the H component (HSV space), as these components are most sensitive to changes in red and can accurately capture color changes during titration.
[0037] Secondly, a background reference dataset is established. Image data prior to the start of the titration pump (e.g., at t=0) is automatically locked and marked as background reference data. Before each titration, multiple frames of images are continuously acquired, and the mean and standard deviation of each component in the converted color space are calculated to generate a stable background reference dataset [L0, a0, b0] or [H0, S0, V0]. The established background reference dataset quantifies the initial physical properties of the test samples, especially accurately recording the initial color differences of the extract (from light yellow to dark brown) for rice samples with different degrees of aging.
[0038] Finally, the relative color difference is calculated. During continuous operation of the titration pump, the relative color difference between the current frame (RIO region frame) and the background reference data is calculated in real time. Specifically, for each newly acquired image frame, the difference between its color components [Lt, at, bt] or [Ht, St, Vt] and the background reference data is calculated, and a weighted calculation formula is applied to generate the color difference value: ColorDiff = w1•|Lt-L0| + w2•|at-a0| + w3•|bt-b0|, where w1, w2, and w3 are weighting coefficients. The "color intensity signal (color difference value)" generated through the weighted calculation reflects only the degree of chemical reaction, effectively eliminating the interference of initial color differences in the samples. This allows for accurate capture of the indicator's color change process in both light and dark rice extracts, enabling adaptive analysis of different samples.
[0039] S3. The color difference value of the rice extract to be measured, calculated in real time, is used as the color intensity signal, and the signal is smoothed and trend analyzed.
[0040] First, a color difference trend curve is established based on sliding window smoothing. To eliminate sensor noise caused by hardware vibration and liquid turbulence, the color intensity signal is digitally filtered in real time. A sliding time window of length N is established, and the Savitzky-Golay polynomial fitting algorithm is applied to the color intensity signal point set {ColorDiff(t-N+1), ..., ColorDiff(t)} within the window. Local polynomial fitting preserves the peak characteristics of the signal while effectively suppressing high-frequency noise. In this embodiment, a third-order polynomial is selected as the fitting function. The resulting smooth trend curve SmoothColorDiff(t) effectively filters out periodic signal fluctuations caused by stirrer rotation, preserving the true trend of indicator color change.
[0041] Secondly, the rate of change of color difference values is monitored and calculated to determine the peak value. A real-time first-order differential operation is performed on the established smooth trend curve to obtain the signal change rate, i.e., the rate of change of color difference values. For time point t, the signal difference between adjacent time points is calculated and divided by the time interval: ColorRate(t) = [SmoothColorDiff(t) - SmoothColorDiff(t-1)] / ,in, The time interval between adjacent sampling points. This color difference rate quantifies the rate of color change in the reaction solution during titration and is an important basis for judging the reaction state. During titration, the indicator color change accelerates suddenly near the endpoint, manifested as a significant increase in the ColorRate value; after the endpoint, the color change tends to stabilize, manifested as a decrease in the ColorRate value. Correspondingly, when the color difference rate meets certain conditions, such as a continuous increase followed by a decrease, a peak in the rate of change can be identified, thus providing dynamic characteristic evidence for endpoint determination and assisting in real-time dynamic monitoring of the titration process. In addition, real-time second-order differential calculations can be performed on the established smooth trend curve to obtain and analyze the acceleration characteristics of color change, which can also provide dynamic characteristic evidence for endpoint determination and assist in real-time dynamic monitoring of the titration process.
[0042] S4. Based on signal smoothing and trend analysis, determine the titration endpoint and titration amount according to the color difference trend curve, the peak value of the color difference change rate and the adaptive threshold.
[0043] First, to improve adaptability to different rice samples, an adaptive threshold is set to accurately determine the titration endpoint. Specifically, based on the background reference data obtained in step S2 above, a dynamic floating threshold is automatically calculated and set. By analyzing the color characteristics of the background reference data, such as the L component (brightness) value, a threshold adjustment function is established: Threshold = BaseThreshold + k(L0 - LStandard); where BaseThreshold is the basic threshold under standard conditions, LStandard is the brightness reference value of the standard sample, and k is the adjustment coefficient. The judgment standard is automatically adjusted according to the sample characteristics: for dark samples (smaller L0), the threshold is automatically increased to avoid background interference; for light samples (larger L0), the threshold is automatically decreased to improve sensitivity.
[0044] Secondly, state change detection is performed to extract the peak value feature of the rate of change. Based on the color difference value change rate calculated in S3 above, the peak value of the color difference value change rate (color difference value change rate peak value) is determined. For example, a historical rate of change queue of length M is maintained {ColorRate(t-M+1), ..., ColorRate(t)}. When a pattern of continuous increase followed by a decrease is detected, that is, when the condition is satisfied: ColorRate(t-2) is met.<ColorRate(t-1)> The peak value of ColorRate(t) is used to determine the presence of a peak in the rate of change, which is considered an important feature indicating the approach of the endpoint. Simultaneously, the significance of the peak is calculated, i.e., the ratio of the peak value to the background: PeakSignificance = ColorRate(t-1) / AverageRate, where AverageRate is the average rate of change of the color difference value in the initial stage (e.g., the first N titration stages). A valid peak feature is considered to exist only when PeakSignificance exceeds a preset threshold for the rate of change of the color difference value, thus avoiding misjudgments caused by minor fluctuations. This automatic peak detection mechanism completely replaces the traditional manual observation and judgment process, improving the objectivity and accuracy of endpoint determination.
[0045] Then, the trigger logic for stopping the titration in the hardware is set. For example: execute the "AND" logic judgment and determine the titration endpoint by combining multi-dimensional features; when the following conditions are met at the same time, it is determined that the titration endpoint has been reached: (1) the color intensity signal SmoothColorDiff(t) is greater than the adaptive threshold Threshold calculated above; (2) the signal change rate shows the above effective peak characteristics; (3) the current color intensity signal is continuously stable, that is, the standard deviation of the most recent K frames at the current time is less than the preset standard deviation value. The above multi-condition combination judgment greatly improves the reliability of the endpoint determination and avoids the misjudgment that may be caused by single feature judgment. Correspondingly, other features of the color difference value trend curve can also be obtained as supplementary conditions through signal smoothing and trend analysis, such as performing real-time second-order differential operation on the established smooth trend curve and finding that it is greater than the preset value.
[0046] Finally, the actuator brakes and measures. Once the titration endpoint is determined, the central controller immediately sends an emergency stop command to the titration pump, terminating the titration process. The central controller cuts off the pulse signal sent to the peristaltic pump and simultaneously sends a deceleration command to the stirrer, causing the reaction solution to stop smoothly. By reading the cumulative pulse count of the stepper motor or the encoder value, the actual volume of standard titration solution consumed is accurately calculated, and the titration amount is determined.
[0047] In addition, considering the possibility of image acquisition failures during the simultaneous acquisition of reaction images during titration, in order to optimize the titration amount, the pulsed addition of the standard titration solution and the multi-view acquisition of reaction solution images were performed simultaneously. After determining the endpoint for each view of the reaction solution image, the titration amount corresponding to the current rice extract sample was obtained by clustering, and the titration amounts corresponding to discrete rice extract samples were removed.
[0048] S5. Based on the titration amount of the current rice extract sample and the associated basic information of the rice extract sample, the fatty acid value is automatically calculated.
[0049] First, the basic information of the rice extract sample being tested is determined. Specifically, after titration, the electronic tag information corresponding to the rice extract sample being tested is automatically retrieved, and the basic information of the sample, including parameters such as sample quality, moisture content, sampling time, and storage conditions, is automatically associated and extracted.
[0050] Then, the fatty acid value is automatically calculated. Using the stoichiometric model built into the central controller, the volume consumed (titration volume) fed back from the hardware is substituted into the formula to automatically calculate the fatty acid value. The calculation formula considers multiple factors such as sample quality, moisture content, and titration solution concentration to ensure the scientific validity and accuracy of the results.
[0051] By adopting the above method, based on the construction of a stable detection environment, synchronous triggering of titration and acquisition, color space conversion, color difference calculation, curve establishment and peak determination, the titration process was analyzed in detail. Then, by using adaptive threshold and multi-condition combination judgment, the titration endpoint was accurately determined and the dry basis fatty acid value was calculated, realizing the accurate automatic determination of rice fatty acid value and improving the accuracy and repeatability of detection.
[0052] In a specific embodiment, considering that the turbidity of rice extract can affect the color signal in actual testing, a photoelectric sensor is added to monitor the real-time turbidity of the reaction solution in order to effectively eliminate turbidity interference. Parameters are dynamically adjusted and color correction is performed based on the turbidity, further improving the accuracy of the detection results. The method includes: First, by adding a photoelectric sensor, the intensity of transmitted light and scattered light of the reaction solution during titration are monitored in real time. Specifically, dual-channel monitoring of 90° scattered light and transmitted light is used. A photodetector is installed at a position 90° perpendicular to the incident light path, and a narrow-band filter (matched to the LED wavelength) is added to shield stray light, monitoring the intensity of scattered light. A photodetector is installed directly behind the incident light path to measure the intensity of transmitted light.
[0053] Secondly, based on the real-time turbidity of the current reaction solution; the specific formulas include: In the formula, Indicates the intensity of scattered light. Indicates the intensity of transmitted light. This represents the adjustment constant.
[0054] Then, based on the real-time turbidity of the quantified reaction solution, the preprocessing parameters of the acquired image and the color difference calculation parameters converted to the Lab or HSV color space are dynamically adjusted. In this embodiment, the image preprocessing parameters include image contrast and saturation. When the values are greater than the preset turbidity, the image contrast and saturation are enhanced to partially compensate for the color information loss caused by turbidity. The color difference calculation parameters of the Lab or HSV color space refer to the weight coefficients corresponding to the weighted calculation of each component. When the real-time turbidity is higher, the corresponding weights of the a component (Lab space) or H component (HSV space) are adaptively updated. The formula is: corresponding weights ; This is an empirical coefficient, such as 0.1.
[0055] Furthermore, a quantitative model can be established to measure the real-time turbidity of the reaction solution and the color decay of the colored solution. This color decay model can be achieved by using the same colored solution as the sample, adding different amounts of standard turbidity substances, acquiring images at different turbidity levels (T), and analyzing their RIO in the Lab color space. The value of T is recorded, and it is recorded as T increases. The absolute value shifts. During titration, for each frame of liquid region image converted to its original Lab or HSV value, based on the color attenuation model, compensation and correction are performed on the original Lab or HSV value under the current real-time turbidity conditions to obtain the corrected Lab or HSV value, as shown in the formula: ;in, You can choose either linear lookup table interpolation or a neural network model.
[0056] In a specific embodiment, to avoid the problems of over-titration or inaccurate endpoint determination that may occur with traditional fixed titration speeds, and to further improve the accuracy and efficiency of detection, a reaction kinetic adaptive titration strategy is adopted. Based on real-time feedback of the weighted color difference rate of change during titration, the titration speed and single titration volume are dynamically adjusted. The method includes: considering that improper control of the volume and timing of pulse titration can easily lead to excessive or insufficient titrant, an optimization of the pulse titration strategy where the amount varies with the reaction progress is selected. Specifically, upon initiating titration, the reaction kinetic adaptive titration of the standard titration solution is selected to replace the pulse titration of the standard titration solution. The reaction kinetic adaptive titration includes: A multi-stage titration strategy, such as a three-stage titration strategy, is set. Different stages of the titration strategy have preset titration rates and single titration volumes. For example, in the rapid titration stage, a large-volume pulse (e.g., 100 μL / pulse) is used, with a titration rate of 3 drops or more per second; in the fine titration stage, a medium titration volume (e.g., 50 μL / pulse) is used, with a titration rate of 1-2 drops per second; and in the endpoint approach stage, a micro-tipping volume (e.g., 10 μL / pulse) is used, with a titration rate of 1 drop per second. Each stage titration strategy also has a preset range of color difference change rates. The larger the preset range of color difference change rates, the slower the titration rate and the smaller the single titration volume in the corresponding stage titration strategy; for example, the preset range of color difference change rates matched with the rapid titration stage is a color difference change rate of less than 5 (…). / s), and the preset color difference change rate range matched with the fine titration stage is a color difference change rate between 5-15 ( / s), and the preset color difference change rate range matched with the endpoint approach titration stage is a color difference change rate greater than 15 ( / s).
[0057] Obtain the preceding time step (e.g.: The feedback color difference value change rate is used to determine the preset color difference value change rate range within which the feedback color difference value change rate falls, and then adaptively matches it to subsequent time intervals. A staged titration strategy is used to assist in the adaptive titration of the reaction kinetics of the standard titration solution.
[0058] In a specific embodiment, considering that the liquid within the reaction vessel may exhibit uneven mixing or localized interference, analysis of a single region may lead to inaccurate results. By defining fixed-position RIO and dynamic RIO, liquid region images corresponding to multiple RIO regions are extracted and analyzed. The titration endpoint results from multiple regions are then combined for judgment. The method includes: In the process of extracting liquid region images by performing edge detection and liquid surface recognition on the acquired images, fixed-position RIOs and dynamic RIOs are defined to improve the robustness of endpoint recognition. Fixed-position RIOs predefine several RIO locations based on the specific location of the titration container, such as the central region, edge region, and intermediate region. Dynamic RIOs are determined in real-time based on image processing, such as vortex regions and uniformly mixed regions. Vortex regions can be identified by performing vortex detection on the acquired image and setting up a ring-shaped RIO around the vortex region. Uniformly mixed regions can be identified by calculating the gray-level variance or gradient of local image regions, i.e., through texture analysis and bubble and deposit detection, selecting regions with uniform texture as ROIs to avoid areas containing bubbles and deposits. Then, based on the defined fixed-position and dynamic RIOs, liquid region images corresponding to multiple RIO regions are extracted.
[0059] Perform a consistency comparison of color difference changes across multiple Regions of Interest (ROIs). Calculate the color difference value between the liquid region image frame corresponding to each ROI and the background reference dataset; that is, at a certain titration time, obtain a sequence of color difference values for multiple ROIs, calculate the statistics of these color difference values, and remove abnormal ROIs. For each ROI after removing abnormal ROIs, comprehensively utilize the color difference values of multiple ROIs to set a multi-region fusion judgment strategy. Specifically, any of the following methods can be selected.
[0060] First, the weighted fusion judgment strategy: by weighting and calculating the color difference values of multiple ROI regions, the color difference value trend curve, color difference value change rate peak and endpoint judgment are further completed based on the weighted calculation of the color difference values of the ROI regions.
[0061] Second, the stratified determination strategy: establish a color difference trend curve for each RIO region and determine the peak value of the color difference change rate for each RIO region; determine the titration endpoint based on the color difference trend curve, peak value of the color difference change rate, and adaptive threshold for each RIO region, and record the determined titration endpoint for each RIO region as a candidate endpoint; check whether the titration endpoints for each ROI region are clustered within the allowable volume error range; if they are clustered within the allowable volume error range, select the median of the candidate endpoints as the final endpoint; otherwise, consider the mixing uneven or the interference too great, generate an extended mixing time prompt or issue a warning.
[0062] Third, based on machine learning fusion judgment, the color features of multiple ROIs (such as color difference value, color difference value change rate, etc.) are used as input features, and classification models (such as support vector machine, random forest) or time series models (such as LSTM) are used to determine the endpoint.
[0063] In one specific embodiment, the accuracy of titration endpoint determination and adaptability to different samples are further improved by adaptively adjusting the liquid region image pixel data conversion method; the method further includes: calculating and obtaining the corresponding matching liquid region image pixel data conversion method based on the mean background color value in the current background reference dataset and the real-time turbidity of the reaction solution.
[0064] Among them, the mean value of the L component or V brightness in the background reference data is used as the mean value of the background color.
[0065] The liquid region image pixel data conversion methods include: conversion to Lab color space, conversion to HSV color space, and conversion to a combined color space. When the background color is light (less than the local average of the first preset color mean) and the turbidity of the reaction solution is low (less than the turbidity of the first preset turbidity), the liquid region image pixel data is converted to Lab color space, and the L, a, and b components are obtained accordingly. When the background color is dark (greater than the local average of the second preset color mean) and the turbidity of the reaction solution is high (greater than the second preset turbidity), the liquid region image pixel data is converted to HSV color space, and the H, S, and V components are obtained accordingly. When the background color is moderate (within the range of the first preset color mean and the second preset color mean) and the turbidity of the reaction solution is moderate (within the range of the first preset color mean and the second preset color mean), the pixel data of the liquid area image is converted to a comprehensive color difference space accordingly. The first preset color mean is less than the second preset color mean, and the first preset turbidity is less than the second preset turbidity. The conversion to the comprehensive color difference space includes: converting to Lab color difference space and HSV color difference space, calculating the key components of each color space respectively, and weighted fusing them to generate a comprehensive color difference value, such as: , Weighted calculation: ; This is a weighting parameter that can be set according to the background color intensity and the turbidity of the reaction solution.
[0066] In one specific embodiment, by determining whether there are any anomalies in the color difference value calculation, a verification process is initiated when an anomaly is detected to promptly identify and correct deviations in the calculation of the color difference value and its rate of change, thereby further improving the accuracy and reliability of the detection results; the method also includes: During titration, the color difference gradually changes with the addition of titrant. A predictive model is built using historical titration strategies and color difference data to predict the color difference at the next titration point, thus allowing for comparison and judgment of the accuracy of the color difference calculation. Specifically, a color difference prediction model can be constructed using deep learning algorithms. The model's input includes the current liquid region image frame, the background reference dataset, and the titration strategy. The output is the predicted color difference value for the next titration. The model is generated through training using historical liquid region image frames, the background reference dataset, the titration strategy, and historical color difference values.
[0067] Calculate the absolute difference between the actual color difference value and the predicted color difference value. It also determines whether the absolute difference is greater than a preset absolute difference threshold; and calculates the absolute value of the difference between the rate of change of color difference values corresponding to adjacent titration points at the current time. Determine whether the absolute value of the difference between the color difference rate changes is greater than the preset color difference rate difference threshold.
[0068] If an absolute difference exceeds a preset absolute difference threshold or the absolute difference exceeds a preset color difference rate difference threshold, it indicates that an abnormal change may have occurred, and the color difference calculation and verification process is initiated. The color difference calculation and verification process includes: reselecting the extracted liquid area image, switching between Lab and HSV color spaces, adjusting the weighting of each component in the converted Lab or HSV values, and recalculating the color difference value.
[0069] like Figure 3 As shown in the figure, this application discloses an automatic detection system for determining the fatty acid value of rice, specifically including: The rice extract sample collection module 100 is used to identify the rice to be tested and generate weighing and extraction instructions for the rice to be tested, so as to control the weighing and extraction device to perform weighing, liquid addition, shaking and filtering operations of the rice to be tested, generate rice extract to be tested, and collect rice extract samples. The rice extract titration image acquisition module 200 is used to construct a standardized optical environment. It dynamically adjusts the light source drive to stabilize the light intensity through feedback from a photosensor. For the rice extract sample to be tested, a magnetic stirrer is activated to generate a stable vortex flow field. Before starting the titration, the identification information of the rice extract sample to be tested is determined and associated with basic information. When starting the titration, the pulsed addition of the standard titration solution and the acquisition of the reaction solution image are performed simultaneously. Edge detection and liquid surface recognition are performed on the acquired images to extract the liquid region image. The rice extract titration color difference extraction module 300 is used to convert the pixel data of the liquid region image to Lab or HSV color space and establish a background reference dataset; and to calculate the color difference value between the current liquid region image frame and the background reference dataset in real time. The rice extract titration feature extraction module 400 is used to establish a color difference value trend curve based on sliding window smoothing; monitor and calculate the color difference value change rate; and determine the peak value of the color difference value change rate. The rice extract titration quantity determination module 500 is used to determine the titration endpoint and determine the titration quantity based on the color difference trend curve, the peak value of the color difference change rate and the adaptive threshold. The rice extract fatty acid value calculation module 600 is used to automatically calculate the fatty acid value based on the titration amount of the current rice extract sample and the associated basic information of the rice extract sample.
[0070] In one specific embodiment, the system further includes: The rice extract titration color difference extraction optimization module 700 is used to monitor the intensity of transmitted light and scattered light of the reaction solution in real time during the titration process by adding a photoelectric sensor, and quantify the real-time turbidity of the current reaction solution; based on the quantified real-time turbidity of the reaction solution, it dynamically adjusts the preprocessing parameters of the acquired image and the color difference value calculation parameters converted to Lab or HSV color space.
[0071] The rice extract titration color difference extraction optimization module 700 is also used to calculate and obtain the corresponding matching liquid region image pixel data conversion method based on the mean background color in the current background reference dataset and the real-time turbidity of the reaction solution.
[0072] In one specific embodiment, the system further includes: The rice extract titration image acquisition and optimization module 800 is used to select adaptive titration of the standard titration solution to replace the pulsed titration of the standard titration solution when starting the titration; to obtain the rate of change of color difference value fed back at the previous time step, to determine the range of the preset rate of change of color difference value where the feedback rate of color difference value changes, and to adaptively match the titration strategy at the subsequent time step to assist in the adaptive titration of the standard titration solution based on the reaction kinetics.
[0073] The rice extract titration image acquisition and optimization module 800 is further configured to define fixed-position RIO and dynamic RIO during the process of performing edge detection and liquid surface recognition on the acquired image to extract the liquid region image; calculate the color difference value between the liquid region image frame corresponding to each RIO region and the background reference dataset; establish a color difference value trend curve corresponding to each RIO region and determine the peak value of the color difference value change rate corresponding to each RIO region; determine the titration endpoint based on the color difference value trend curve, the peak value of the color difference value change rate and the adaptive threshold corresponding to each RIO region, and record the determined titration endpoint corresponding to each RIO region as a candidate endpoint; check whether the titration endpoints corresponding to each ROI region are clustered within the allowable volume error range; if they are clustered within the allowable volume error range, the median of the candidate endpoints is selected as the final endpoint; otherwise, it is considered that the mixing is uneven or the interference is too great, and a prompt to extend the mixing time or a warning is generated.
[0074] In one specific embodiment, the system further includes: The rice extract titration color difference verification module 900 is used to predict the color difference value between the extracted liquid region image frame and the background reference dataset using a deep learning algorithm combined with a titration strategy; calculate the absolute difference between the actual color difference value and the predicted color difference value, and determine whether the absolute difference value is greater than a preset absolute difference threshold; calculate the absolute value of the difference between the rate of change of color difference values corresponding to adjacent titration points at the current time, and determine whether the absolute value of the difference between the rate of change of color difference values is greater than a preset color difference rate of change threshold; if there is an absolute difference value greater than the preset absolute difference threshold or the absolute value of the difference is greater than the preset color difference rate of change threshold, then the color difference value calculation verification process is initiated; the color difference value calculation verification process includes: reselecting the extracted liquid region image, switching between Lab and HSV color spaces, adjusting the weighting weights of each component in the converted Lab or HSV values, and recalculating the color difference value by weighting.
[0075] In one specific embodiment, the system further includes: The rice extract titration quantity determination and optimization module 110 is used to select and simultaneously perform pulsed titration of standard titration solution and multi-view acquisition of reaction solution images. After determining the determination endpoint for each view of the reaction solution image, it clusters to obtain the titration quantity corresponding to the current rice extract sample and removes discrete rice extract sample titration quantities.
[0076] This application also discloses a computer-readable storage medium.
[0077] Specifically, the computer-readable storage medium stores a computer program that can be loaded by a processor and executed as described above for the automatic detection method for determining the fatty acid value of rice. The computer-readable storage medium includes, for example, various media capable of storing program code, such as a USB flash drive, a portable hard drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.
[0078] This application also discloses a computer device.
[0079] Specifically, the computer device includes a memory and a processor, the memory storing a computer program that can be loaded by the processor and executed to perform the aforementioned automatic detection method for determining the fatty acid value of rice.
[0080] The above are all preferred embodiments of this application and are not intended to limit the scope of protection of this application. Any feature disclosed in this specification (including the abstract and drawings) may be replaced by other equivalent or similar features unless specifically stated otherwise. That is, unless specifically stated otherwise, each feature is only one example of a series of equivalent or similar features.
Claims
1. An automated detection method for determining the fatty acid value of rice, characterized in that, include: Identify the rice grains to be tested; generate weighing and extraction instructions for the rice grains to be tested, and control the weighing and extraction device to perform weighing, liquid addition, shaking, and filtration operations to generate the rice grain extract; collect samples of the rice grain extract. A standardized optical environment was constructed, and the light source drive was dynamically adjusted to stabilize the light intensity through feedback from a photosensitive sensor; for the rice extract sample to be tested, a magnetic stirrer was activated to generate a stable vortex flow field; Before starting the titration, determine the identification information of the rice extract sample to be tested and associate it with the basic information; When the titration is started, the pulsed addition of the standard titration solution and the acquisition of images of the reaction solution are performed simultaneously. Edge detection and liquid surface recognition are performed on the acquired images to extract liquid region images; Convert the pixel data of the liquid region image to Lab or HSV color space and establish a background reference dataset; Calculate the color difference between the current liquid region image frame and the background reference dataset in real time; A color difference value trend curve is established based on sliding window smoothing processing. Monitor and calculate the rate of change of color difference values, and determine the peak value of the rate of change of color difference values; The titration endpoint is determined based on the color difference trend curve, the peak value of the color difference change rate, and the adaptive threshold, and the titration amount is determined accordingly. Based on the titration amount of the current rice extract sample and the basic information of the associated rice extract samples, the fatty acid value is automatically calculated.
2. The automatic detection method for determining the fatty acid value of rice according to claim 1, characterized in that, Also includes: By adding a photoelectric sensor, the intensity of transmitted light and scattered light of the reaction solution during the titration process can be monitored in real time, and the real-time turbidity of the reaction solution can be quantified. Based on the real-time turbidity of the quantified reaction solution, the preprocessing parameters of the acquired image and the color difference calculation parameters converted to Lab or HSV color space are dynamically adjusted.
3. The automatic detection method for determining the fatty acid value of rice according to claim 1, characterized in that, Also includes: When starting the titration, the reaction kinetics adaptive titration of the standard titration solution is selected to replace the pulsed titration of the standard titration solution. The adaptive dropping method based on reaction kinetics includes: A multi-stage titration strategy is set up, with different stages of titration strategy having corresponding preset titration speeds and single titration volumes. Each stage of titration strategy is also set with a preset range of color difference change rate. The larger the preset range of color difference change rate, the slower the titration speed and the smaller the single titration volume in the corresponding stage of titration strategy. The rate of change of color difference value fed back from the previous time step is obtained, and the range of the rate of change of color difference value fed back is determined to adaptively match the titration strategy in the subsequent time step to assist in the adaptive titration of the reaction kinetics of the standard titration solution.
4. The automatic detection method for determining the fatty acid value of rice according to claim 1, characterized in that, Also includes: In the process of performing edge detection and liquid surface recognition on the acquired images to extract liquid region images, fixed position RIO and dynamic RIO are defined to extract liquid region images corresponding to multiple RIO regions; The dynamic RIO performs vortex detection on the acquired image, sets up a ring RIO around the vortex region, and selects a region with uniform texture as the ROI through texture analysis and bubble and attachment detection, while removing regions with bubbles and attachments. Calculate the color difference between the liquid region image frame corresponding to each RIO region and the background reference dataset; establish the color difference trend curve for each RIO region and determine the peak value of the color difference change rate for each RIO region; The titration endpoint is determined based on the color difference trend curve, peak value of color difference change rate, and adaptive threshold corresponding to each RIO region. The titration endpoint corresponding to each RIO region is recorded as a candidate endpoint. It is checked whether the titration endpoints corresponding to each ROI region are clustered within the allowable volume error range. If they are clustered within the allowable volume error range, the median of the candidate endpoints is selected as the final endpoint. Otherwise, it is considered that the mixing is uneven or the interference is too great, and a prompt to extend the mixing time or a warning is issued.
5. The automatic detection method for determining the fatty acid value of rice according to claim 2, characterized in that, Also includes: Calculate and obtain the corresponding matching liquid region image pixel data conversion method based on the mean background color value in the current background reference dataset and the real-time turbidity of the reaction solution; The liquid region image pixel data conversion method includes: converting the liquid region image pixel data to the Lab color difference space if it matches the local mean value which is less than the first preset color mean value and the turbidity which is less than the first preset turbidity; converting the liquid region image pixel data to the HSV color difference space if it matches the local mean value which is greater than the second preset color mean value and the turbidity which is greater than the second preset turbidity; and converting the liquid region image pixel data to a comprehensive color difference space if it matches the local mean value which is within the range of the first preset color mean value and the second preset color mean value and the turbidity which is within the range of the first preset turbidity and the second preset turbidity. The conversion to the comprehensive color difference space includes: converting to the Lab color difference space and the HSV color difference space, calculating the key components of each color space respectively, and weighted fusing to generate a comprehensive color difference value.
6. The automatic detection method for determining the fatty acid value of rice according to claim 3, characterized in that, Also includes: Using deep learning algorithms and a titration strategy, the color difference between the extracted liquid region image frame and the background reference dataset is predicted. Calculate the absolute difference between the actual color difference value and the predicted color difference value, and determine whether the absolute difference value is greater than the preset absolute difference value threshold. Calculate the absolute value of the difference between the rate of change of color difference values corresponding to adjacent titration points at the current time, and determine whether the absolute value of the difference between the rate of change of color difference values is greater than the preset threshold value for the difference between the rate of change of color difference values. If an absolute difference exceeds a preset absolute difference threshold or an absolute difference exceeds a preset color difference rate difference threshold, the color difference calculation and verification process will be initiated. The color difference value calculation and verification process includes: reselecting the extracted liquid area image, switching between Lab and HSV color spaces, adjusting the weighting of each component in the converted Lab or HSV values, and recalculating the color difference value.
7. The automatic detection method for determining the fatty acid value of rice according to claim 1, characterized in that, Also includes: The pulsed addition of the standard titration solution and the multi-view acquisition of the reaction solution images were selected to be performed simultaneously. After determining the endpoint for the reaction solution images acquired from each view, the titration amount corresponding to the current rice extract sample was obtained by clustering, and the titration amounts corresponding to discrete rice extract samples were removed.
8. An automatic detection system for determining the fatty acid value of rice, characterized in that, include: The rice extract sample collection module is used to identify the rice to be tested; for the rice to be tested, it generates weighing and extraction instructions to control the weighing and extraction device to perform weighing, liquid addition, shaking and filtering operations of the rice to be tested, and to generate the rice extract to be tested; and collects the rice extract sample to be tested. The rice extract titration image acquisition module is used to construct a standardized optical environment and dynamically adjust the light source drive to stabilize the light intensity through feedback from the photosensitive sensor; for the rice extract sample to be tested, the magnetic stirrer is activated to generate a stable vortex flow field. Before starting the titration, determine the identification information of the rice extract sample to be tested and associate it with the basic information; when starting the titration, simultaneously perform pulsed addition of the standard titration solution and acquire images of the reaction solution. Edge detection and liquid surface recognition are performed on the acquired images to extract liquid region images; The rice extract titration color difference extraction module is used to convert the image pixel data of the liquid area to Lab or HSV color space and establish a background reference dataset; Calculate the color difference between the current liquid region image frame and the background reference dataset in real time; The feature extraction module for rice extract titration is used to establish a color difference trend curve based on sliding window smoothing. Monitor and calculate the rate of change of color difference values, and determine the peak value of the rate of change of color difference values; The rice extract titration quantity determination module is used to determine the titration endpoint and determine the titration quantity based on the color difference trend curve, the peak value of the color difference change rate, and the adaptive threshold. The fatty acid value calculation module for rice extract is used to automatically calculate the fatty acid value based on the titration amount of the current rice extract sample and the associated basic information of the rice extract sample.
9. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes a stored computer program, wherein, when the computer program is executed, it controls the device on which the computer-readable storage medium is located to perform the method as described in any one of claims 1 to 7.
10. A computer device, characterized in that, The computer device includes a memory, a processor, and a program stored in and executable on the memory, the program being executed by the processor to implement the steps of the method as described in any one of claims 1 to 7.