Full-automatic oil acidity detection system based on machine vision

By combining time-series analysis of images and environmental data, the cumulative effect of environmental factors is quantified, solving the problems of dynamic changes and environmental impact in oil acidity detection, and achieving more accurate oil acidity detection.

CN121499497BActive Publication Date: 2026-03-17DALIAN BAHNEN PETROLEUM INSTR +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202610032893.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2026-01-12
Publication Date
2026-03-17
Estimated Expiration
2046-01-12

AI Technical Summary

Technical Problem

Existing machine vision-based methods for detecting oil acidity cannot reflect the dynamic changes in oil acidity during storage or testing, which can easily lead to missed or false alarms. Furthermore, the handling of environmental factors is limited to instantaneous compensation, resulting in inaccurate detection results.

Method used

Digital images and environmental data of oil samples are collected by image sensors and environmental sensors. Combined with temperature and light information, time series alignment and normalization are performed to calculate the acidity change rate and quantify the cumulative effect of environmental factors, enabling dynamic analysis and multi-condition verification.

Benefits of technology

It improves the reliability of oil acidity detection, can keenly identify early gradual trends or brief abnormal signals, reduces detection errors in complex environments, and enhances the ability to warn of slow-moving faults.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121499497B_ABST
    Figure CN121499497B_ABST
Patent Text Reader

Abstract

The present application relates to machine vision and oil analysis technical field, disclose a kind of oil acidity full-automatic detection system based on machine vision.The system includes through initial acquisition, feature conversion, time sequence segmentation, environmental accumulation, abnormality determination and result synthesis link to realize detection.Initial acquisition link synchronously acquires oil image and temperature, illumination data;Feature conversion link analyzes color and transmittance characteristics and normalizes, exports acidity characteristic value;Time sequence segmentation link calculates the change rate of adjacent samples in sequence, and divides stable and variation section;Environmental accumulation link integrates temperature and illumination trend in stable section, quantifies its cumulative effect;Abnormality determination link verifies abnormal point by integrating environmental accumulation result and variation section information;Result synthesis link generates final report.The system distinguishes oil itself deterioration and environmental disturbance by analyzing acidity dynamic change trend and quantifying environmental cumulative effect, improves the accuracy and reliability of detection.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the fields of machine vision and oil analysis technology, specifically to a fully automated oil acidity detection system based on machine vision. Background Technology

[0002] Oil acidity is a key indicator for evaluating its quality and aging degree. Traditional chemical titration methods are cumbersome, time-consuming, and reliant on operator experience, making them unsuitable for the online and rapid testing needs of modern industry. In recent years, machine vision-based detection methods have gained popularity due to their speed and non-contact advantages. Existing technologies typically use image sensors to acquire visual information such as oil sample color and transmittance, combined with environmental sensor readings, to directly calculate the acidity value using an established model. These methods treat each measurement as an independent event, focusing only on the sample state and environmental parameters at the instant of a single measurement.

[0003] Existing technical solutions have shortcomings. Static and isolated analysis models cannot reflect the dynamic changes in oil acidity during storage or testing. Since oil oxidation and deterioration is a continuous chemical process influenced by environmental factors, single-point measurements cannot distinguish between normal acidity fluctuations and early signs of abnormal deterioration, nor can they assess the consequences of sustained environmental stress. When acidity experiences slow drift or transient anomalies, single-point judgment methods based on fixed thresholds are prone to false negatives or false negatives.

[0004] Conventional techniques for addressing environmental factors often remain at the level of instantaneous compensation. This method ignores the cumulative effect of environmental factors such as temperature and light on oil acidity. In practical applications, oil may undergo prolonged, minor environmental changes, the cumulative effect of which alters the acidity change trajectory. Instantaneous compensation models cannot quantify this time-varying interference, leading to discrepancies between the test results and the actual acidity level, thus reducing the reliability of testing under complex operating conditions. Summary of the Invention

[0005] The purpose of this invention is to provide a fully automated oil acidity detection system based on machine vision to solve the problems mentioned in the background art.

[0006] To achieve the above objectives, the present invention provides a fully automated oil acidity detection system based on machine vision, the system comprising:

[0007] In the initial acquisition phase, digital images of oil samples are captured by an image sensor and the acquisition time is recorded. At the same time, temperature and light intensity readings corresponding to the samples are obtained by an environmental sensor. The image data and environmental data are aligned and fused according to the time series.

[0008] The feature conversion stage receives the output data from the initial acquisition stage, analyzes the color distribution features and transmittance features from the digital image, performs normalization calculations by combining temperature readings and light intensity readings, and outputs a comprehensive acidity feature value.

[0009] The temporal segmentation step processes the comprehensive acidity feature value sequence generated by the feature transformation step, arranges the samples in the order of collection time, calculates the acidity change rate between adjacent samples, and divides the sequence into stable segments and variable segments according to a preset threshold.

[0010] The environmental accumulation stage analyzes the impact of temperature and light change trends on acidity characteristics in the stable segments identified by the time-series segmentation stage, and quantifies the cumulative effect of environmental factors through integral calculations.

[0011] The anomaly detection step scans the output of the environmental accumulation step, combines the information of the variation segment to screen acidity anomalies, and performs multiple condition verifications.

[0012] The result synthesis stage integrates the verified anomalies from the anomaly detection stage to generate the final detection report.

[0013] Preferably, the output data of the initial acquisition stage includes a timestamp-aligned image matrix, temperature data stream, and illumination data stream; the output data of the feature conversion stage includes color channel mean vector, transmittance grayscale value, temperature normalization factor, and illumination normalization factor; the division results of the time-series segmentation stage include stable segment start and end markers, variable segment start and end markers, and acidity change rate sequence; the quantification results of the environmental accumulation stage include temperature accumulation weight coefficient, illumination accumulation weight coefficient, and acidity response integral value; the verified anomaly points of the anomaly determination stage include anomaly time points, environmental fluctuation amplitude, and acidity deviation index; and the final detection report of the result synthesis stage includes an anomaly sample list, risk level classification, and time interval label.

[0014] Preferably, the initial data acquisition step includes:

[0015] The image capture unit uses a high-resolution digital camera to capture color images of oil samples and adds millisecond-level time stamps;

[0016] The environmental monitoring unit collects real-time ambient temperature and light intensity values ​​around the sample using a temperature probe and a photometer.

[0017] The data synchronization unit receives image data output by the image capture unit and environmental data output by the environmental monitoring unit, and uses a time matching algorithm to synchronize the two types of data to a unified time axis, generating time-aligned data packets.

[0018] Preferably, the feature conversion step includes:

[0019] The image analysis unit analyzes the digital image output from the initial acquisition stage, calculates the average intensity of the red, green and blue components as color distribution features, and calculates the average gray value of the central region of the image as transmittance features.

[0020] The environmental adjustment unit extracts the temperature reading and light intensity reading output from the initial acquisition stage, performs minimum-maximum normalization on the temperature data, and performs standard deviation normalization on the light intensity data to generate temperature normalization factor and light intensity normalization factor.

[0021] The feature fusion unit linearly combines the color distribution features and transmittance features of the image analysis unit with the temperature normalization factor and illumination normalization factor of the environment adjustment unit to output a comprehensive acidity feature value.

[0022] Preferably, the time-series segmentation step includes:

[0023] The sequence arrangement unit obtains the comprehensive acidity feature value sequence output by the feature transformation step, sorts it in ascending order according to the collection timestamp, and generates a time sequence.

[0024] The rate of change calculation unit traverses the time sequence and calculates the ratio of the difference in the comprehensive acidity characteristic value between every two consecutive samples to the time interval as the acidity rate of change.

[0025] The segment labeling unit compares the absolute value of each acidity change rate with a preset threshold, and marks continuous samples below the threshold as stable segments and samples above the threshold as variable segments.

[0026] Preferably, the environmental accumulation process includes:

[0027] The trend analysis unit extracts temperature data sequences and illumination data sequences for the stable segments identified in the time-series segmentation process, calculates the instantaneous rate of change of the temperature sequence as the temperature change trend, and calculates the instantaneous rate of change of the illumination sequence as the illumination change trend.

[0028] The integral calculation unit performs a dot product operation between the temperature change trend and the light change trend and the acidity change of the corresponding sample, respectively, to obtain the temperature cumulative weighting coefficient and the light cumulative weighting coefficient.

[0029] The cumulative output unit accumulates the temperature cumulative weighting coefficient and the light cumulative weighting coefficient for each sample, and calculates the acidity response integral value by combining the acidity change.

[0030] Preferably, the anomaly determination step includes:

[0031] The preliminary scanning unit examines the acidity response integral value output by the environmental accumulation loop and selects samples whose integral values ​​exceed the average baseline and are located in the variation range as candidate outliers.

[0032] The verification logic unit checks whether the temperature change trend and the light change trend of each candidate anomaly point exceed the fluctuation range at the same time, and checks whether the acidity change rate is continuously abnormal. Points that pass the test are included in the set of anomaly points after verification.

[0033] The result transmission unit will send the verified set of anomalies, along with timestamps and environmental parameters, to the next stage.

[0034] Preferably, the result synthesis step includes:

[0035] The data collection unit receives the verified set of anomalies output by the anomaly determination stage and extracts the sample identifier, collection time, ambient temperature and light intensity of each anomaly.

[0036] The risk calculation unit calculates the risk score for each anomaly point based on the acidity response integral value and the magnitude of environmental fluctuations, and classifies the risk level according to the risk score.

[0037] The report preparation unit formats the risk sample list, risk level, and time interval labels into a table structure and outputs the final test report.

[0038] Preferably, the image capture unit includes:

[0039] The illumination management subunit adjusts the brightness and angle of the light source around the camera to ensure uniform illumination distribution during image acquisition;

[0040] The image acquisition subunit controls the camera's focal length and exposure time to capture high-resolution color images;

[0041] The time-stamping subunit adds a time stamp accurate to milliseconds to each image.

[0042] Preferably, the image parsing unit includes:

[0043] The color extraction subunit separates the red, green, and blue channels of the digitized image and calculates the average pixel value of each channel.

[0044] The transmittance calculation subunit selects the central rectangular area of ​​the image and calculates the average gray value of the pixels within that area;

[0045] The feature output subunit combines the average value of the color channels and the gray value of the transmittance into a feature vector.

[0046] Compared with the prior art, the beneficial effects of the present invention are:

[0047] By calculating the rate of change in acidity among samples arranged in a time series and dividing the series into stable and variable segments accordingly, this technique transforms the analytical dimension from static points to dynamic processes. This method can keenly identify whether acidity is in a stable state or a rapidly changing phase, thereby capturing early gradual trends or transient abnormal signals that are easily overlooked in traditional single-detection studies. The segmentation based on the rate of change provides crucial temporal context for anomaly detection, enabling the system to distinguish between normal fluctuations and potential signs of deterioration, enhancing the early warning sensitivity for slowly developing faults, and providing a basis for avoiding missed detections due to temporary normality at a single point.

[0048] For stable zones, integral calculations are used to quantify the cumulative effects of temperature and illumination trends, elevating the assessment of environmental impact from instantaneous compensation to a process-based quantitative level. This technique reflects the nonlinear effects of continuous environmental stress, rather than performing simple single-point linear corrections. By quantifying the cumulative contribution of environmental factors, it is possible to effectively separate the portion of acidity changes caused by long-term, slow changes in external conditions from those caused by alterations in the oil's own chemical properties, reducing the inherent uncertainty of single-point compensation under complex real-world environments such as non-constant temperature and varying illumination.

[0049] The combination of dynamic change rate analysis and the quantification of environmental cumulative effects constitutes a progressive diagnostic logic from macro-level situation identification to micro-level attribution analysis. Time-series segmentation first identifies key anomalous periods or change nodes requiring attention, while environmental cumulative analysis assesses the long-term impact weight of external conditions within these critical periods. This combination ensures that the final anomaly determination is based not only on deviations from state values ​​but also on a deep analysis of the dynamic characteristics of the deviation process and external triggers, thereby constructing a more comprehensive and robust diagnostic framework and improving the reliability of the conclusions. Attached Figure Description

[0050] Figure 1 This is a schematic diagram illustrating the working principle of the fully automated oil acidity detection system based on machine vision described in this invention.

[0051] Figure 2 A flowchart illustrating the internal processing of the initial data acquisition stage;

[0052] Figure 3 A flowchart illustrating the internal processing of the feature conversion stage;

[0053] Figure 4 This is an analysis diagram of the feature transformation process;

[0054] Figure 5 This is a time-series segmentation and environmental cumulative analysis diagram. Detailed Implementation

[0055] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0056] Please see Figure 1 This invention provides a fully automated oil acidity detection system based on machine vision. The system includes: an initial acquisition stage that captures digital images of oil samples using an image sensor and records the acquisition time, while simultaneously acquiring temperature and light intensity readings corresponding to the samples using an environmental sensor; the image data and environmental data are aligned and fused according to a time sequence. A feature conversion stage receives the output data from the initial acquisition stage, analyzes color distribution and transmittance features from the digital images, performs normalization calculations based on temperature and light intensity readings, and outputs a comprehensive acidity feature value. A time-series segmentation stage processes the comprehensive acidity feature value sequence generated by the feature conversion stage, arranges samples in chronological order of acquisition time, calculates the acidity change rate between adjacent samples, and divides the sequence into stable and variable segments based on a preset threshold. An environmental accumulation stage analyzes the impact of temperature and light intensity change trends on acidity characteristics within the stable segments identified by the time-series segmentation stage, quantifying the cumulative effect of environmental factors through integral calculations. An anomaly detection stage scans the output results of the environmental accumulation stage, filters acidity anomalies based on variable segment information, and performs multiple condition verifications. The result synthesis stage integrates the verified anomalies from the anomaly detection stage to generate the final detection report.

[0057] Example 1: In specific implementation, the output data of the initial acquisition stage includes a timestamp-aligned image matrix, a temperature data stream, and an illumination data stream. The timestamp-aligned image matrix is ​​a two-dimensional pixel array formed by aligning the digitized image captured by the image sensor with the acquisition time. The temperature data stream is a sequence of temperature readings continuously acquired by the environmental sensor arranged in chronological order. The illumination data stream is a sequence of illumination intensity readings continuously acquired by the environmental sensor arranged in chronological order. The output data of the feature conversion stage includes a color channel mean vector, a transmittance grayscale value, a temperature normalization factor, and an illumination normalization factor. The color channel mean vector is a multi-dimensional vector composed of the average intensity values ​​of the red, green, and blue channels resolved from the digitized image. The transmittance grayscale value is a scalar of the average grayscale value of the pixels in the central region of the image. The temperature normalization factor is a standardized value obtained by performing min-max normalization on the temperature readings. The illumination normalization factor is a standardized value obtained by performing standard deviation normalization on the illumination intensity readings. The temporal segmentation results include start and end markers for stable regions, start and end markers for variable regions, and a sequence of acidity change rates. The start and end markers for stable regions are index pairs indicating the start and end positions of consecutive samples with acidity change rates below a preset threshold. The start and end markers for variable regions are index pairs indicating the start and end positions of samples with acidity change rates above a preset threshold. The acidity change rate sequence is a sequence arranged chronologically by the ratio of the difference in comprehensive acidity characteristic values ​​between adjacent samples to the time interval. In some embodiments, the quantification results of the environmental accumulation stage include a temperature cumulative weighting coefficient, a light cumulative weighting coefficient, and an acidity response integral value. The temperature cumulative weighting coefficient is the cumulative effect of temperature change trends on acidity characteristics, quantified through integration. The light cumulative weighting coefficient is the cumulative effect of light change trends on acidity characteristics, quantified through integration. The acidity response integral value is a comprehensive scalar value calculated by combining the temperature and light cumulative weighting coefficients. The verified anomalies in the anomaly detection phase include anomaly time points, environmental fluctuation amplitudes, and acidity deviation indices. Anomaly time points are the collection timestamp sequences corresponding to the verified anomalies. Environmental fluctuation amplitudes are the numerical ranges of temperature and light intensity changes. The acidity deviation index is the scalar difference between the acidity response integral value and the average baseline. The final test report in the results synthesis phase includes an anomaly sample list, risk level classification, and time interval labels. The anomaly sample list is a table listing the sample identifiers of all verified anomalies. The risk level classification is an enumeration of values ​​that divides anomalies into different levels based on risk scores. The time interval labels are the start and end times of the collection time interval where the anomaly point is located. Each element in the acidity change rate sequence can be understood as being calculated using the following formula:

[0058]

[0059] in: This represents the rate of change in acidity for the i-th sample. This represents the overall acidity characteristic value of the i-th sample. This represents the overall acidity characteristic value of the (i-1)th sample. This represents the time interval between the i-th sample and the (i-1)-th sample. Optionally, the elements of the color channel mean vector include the red channel mean, green channel mean, and blue channel mean, which are obtained by calculating the pixel average of the corresponding channel in the digitized image. In some embodiments, temperature normalization factors and illumination normalization factors are used to adjust the weights of color distribution features and transmittance features during feature fusion to ensure that the influence of environmental factors is reasonably compensated. In specific implementations, the start and end markers of stable sections and the start and end markers of variable sections are stored in array form for data processing in subsequent environmental accumulation and anomaly determination stages. It can be understood that the calculation of the acidity response integral value involves the summation of the temperature accumulation weight coefficient and the illumination accumulation weight coefficient, combined with the acidity change for integral calculation. Optionally, the risk level classification is based on the acidity deviation index and the environmental fluctuation amplitude, which are calculated by linear combination to obtain a risk score, and then the level is divided according to a preset threshold.

[0060] Example 2: See Figure 2In its implementation, the initial data acquisition phase includes an image capture unit, an environmental monitoring unit, and a data synchronization unit. The image capture unit uses a high-resolution digital camera to capture color images of the oil samples and adds millisecond-level timestamps. The environmental monitoring unit collects real-time ambient temperature and light intensity values ​​around the samples using a temperature probe and a photometer. The data synchronization unit receives the image data output by the image capture unit and the environmental data output by the environmental monitoring unit, and uses a time-matching algorithm to synchronize the two types of data onto a unified timeline, generating time-aligned data packets. The specific implementation of the time-matching algorithm includes: the data synchronization unit reads the image data output by the image capture unit and its added millisecond-level timestamps, and simultaneously reads the environmental data output by the environmental monitoring unit and its corresponding timestamps; the algorithm sorts the image data and environmental data according to the time sequence based on the order of the timestamps, and achieves data pairing by comparing whether the difference in timestamps is within the allowable tolerance range; for timestamp-matched data pairs, the algorithm integrates them onto a unified timeline to form time-aligned data packets, ensuring that each image data point has a consistent time reference with its corresponding environmental data point. The image capture unit includes a lighting management subunit, an image acquisition subunit, and a time stamping subunit. The lighting management subunit adjusts the brightness and angle of the light source around the camera to ensure uniform illumination distribution during image acquisition. The image acquisition subunit controls the camera's focal length and exposure time to capture high-resolution color images. The time stamping subunit adds a millisecond-accurate acquisition time stamp to each image. In some embodiments, the time matching algorithm achieves data alignment by calculating the absolute difference between the image capture timestamp and the environmental data timestamp, expressed by the formula:

[0061]

[0062] in: Indicates the timestamp difference. Indicates the image capture timestamp. Represents the timestamp of environmental data, when Less than or equal to the preset threshold At this time, image data and environmental data are considered synchronized. It can be understood that the time-aligned data packets contain timestamp-aligned image matrices, temperature data streams, and illumination data streams, which are used for subsequent feature transformation processing. Optionally, the illumination management subunit maintains illumination consistency during image acquisition by adjusting the brightness and angle of the light source, the image acquisition subunit ensures image quality by setting camera parameters, and the time stamping subunit assigns a unique time stamp to each image using a high-precision clock. In some embodiments, the temperature probe and photometer of the environmental monitoring unit acquire data at a fixed sampling frequency, and the data synchronization unit matches and fuses the acquired environmental data with the image data according to a time sequence. It can be understood that the time matching algorithm processes the time deviation of data from different sensors, generating a data sequence on a unified time axis. Optionally, the data from the image capture unit and the environmental monitoring unit are associated through timestamps, and the data synchronization unit outputs time-aligned data packets for use in subsequent stages.

[0063] Example 3: See Figure 3 In its implementation, the feature conversion stage includes an image analysis unit, an environment adjustment unit, and a feature fusion unit. The image analysis unit analyzes the digitized image output from the initial acquisition stage, calculating the average intensity of the red, green, and blue components as color distribution features, and simultaneously calculating the average grayscale value of the central region of the image as transmittance features. The environment adjustment unit extracts the temperature and light intensity readings output from the initial acquisition stage, performs minimum-maximum normalization on the temperature data, and standard deviation normalization on the light intensity data, generating temperature and light intensity normalization factors. The feature fusion unit linearly combines the color distribution features and transmittance features from the image analysis unit with the temperature and light intensity normalization factors from the environment adjustment unit to output a comprehensive acidity feature value. The image analysis unit includes a color extraction subunit, a transmittance calculation subunit, and a feature output subunit. The color extraction subunit separates the red, green, and blue channels of the digitized image and calculates the average pixel value for each channel. The transmittance calculation subunit selects a rectangular region in the center of the image and calculates the average grayscale value of the pixels within that region. The feature output subunit combines the average color channel values ​​and the transmittance grayscale value into a feature vector. In some embodiments, the feature fusion unit achieves linear combination through weighted summation, as expressed by the formula:

[0064]

[0065] in: This represents the overall acidity characteristic value. Indicates color distribution characteristics, Indicates the grayscale value of light transmittance. Represents the temperature normalization factor. Represents the illumination normalization factor. , , , This represents a predefined weighting coefficient. It can be understood that the color distribution features originate from the combination of the average intensities of the red, green, and blue channels, while the transmittance grayscale value originates from the calculation of the average grayscale value of the central region of the image. Optionally, the environment adjustment unit performs min-max normalization on the temperature data, mapping the temperature readings to a range between zero and one, and performs standard deviation normalization on the illumination data, making the mean of the illumination readings zero and the standard deviation one. In some embodiments, the feature vector generated by the feature output subunit includes the average color channel values ​​and the transmittance grayscale value, which serves as one of the inputs to the feature fusion unit. It can be understood that the linear combination operation of the feature fusion unit integrates multiple features into a single comprehensive acidity feature value for subsequent temporal segmentation processing. Optionally, the color extraction subunit separates the red, green, and blue channels of the color image using image processing algorithms and calculates the arithmetic mean of the pixel values ​​for each channel. In a specific implementation, the rectangular region at the center of the image defined by the transmittance calculation subunit has a fixed size, and the transmittance calculation subunit calculates the average grayscale value of all pixels within this region as the transmittance feature.

[0066] See Figure 4 This paper demonstrates the key data processing procedures and results of the feature transformation stage in an oil acidity detection system. The figure presents multidimensional feature data extracted from the original oil image, including color distribution features, transmittance features, and normalized environmental parameter factors. Color distribution features reflect the optical properties of the oil sample under different spectral channels, while transmittance features characterize the oil's clarity and optical penetration. The environmental adjustment unit standardizes the collected temperature and illumination data, generating corresponding normalization factors to eliminate the influence of environmental fluctuations on the detection results. The feature fusion unit integrates various features into a comprehensive acidity feature value using a linear combination algorithm, which serves as the basis for subsequent time-series analysis. The graph clearly shows the trend of each feature component over time and its contribution to the final comprehensive acidity feature value, demonstrating the crucial role of the feature transformation stage in oil acidity detection.

[0067] Example 4: In specific implementation, the time-series segmentation stage includes a sequence arrangement unit, a rate of change calculation unit, and a segment marking unit. The sequence arrangement unit obtains the comprehensive acidity feature value sequence output by the feature transformation stage, sorts it in ascending order according to the collection timestamp, and generates a time sequence. The rate of change calculation unit traverses the time sequence and calculates the ratio of the difference in comprehensive acidity feature value between every two consecutive samples to the time interval as the acidity change rate. The segment marking unit compares the absolute value of each acidity change rate with a preset threshold, marking consecutive samples below the threshold as stable segments and samples above the threshold as variable segments. The environmental accumulation stage includes... The system includes a trend analysis unit, an integral calculation unit, and a cumulative output unit. The trend analysis unit extracts temperature and illumination data sequences from the stable segments identified in the time-series segmentation process. It calculates the instantaneous rate of change of the temperature sequence as the temperature trend and the instantaneous rate of change of the illumination sequence as the illumination trend. The integral calculation unit performs a dot product operation on the temperature and illumination trends with the corresponding acidity changes of the samples, obtaining cumulative weighting coefficients for temperature and illumination. The cumulative output unit sums the cumulative weighting coefficients for temperature and illumination for each sample and calculates the integral value of the acidity response based on the acidity change. In some embodiments, the dot product operation is implemented using the following formula:

[0068]

[0069] in: This represents the cumulative temperature weighting coefficient for sample i. This indicates the temperature change trend of sample i. This represents the change in acidity for sample i, defined as the difference in the overall acidity characteristic values ​​among consecutive samples. The acidity change rate sequence can be understood as distinguishing between stable and variable segments. Stable segments contain consecutive samples with acidity change rates below a preset threshold, while variable segments contain samples with acidity change rates above the preset threshold. Optionally, referring to Table 1, the segment labeling unit uses an array to store the start and end markers of stable and variable segments; these markers serve as indices pointing to the sample positions in the time sequence.

[0070] Table 1: Acidity Change Rate Sequence and Segment Marker Table

[0071] ;

[0072] In some embodiments, the trend analysis unit calculates the instantaneous rate of change of the temperature sequence using a front-to-back difference method, and calculates the instantaneous rate of change of the illumination sequence using a similar method. The temperature change trend and the illumination change trend are used as vector inputs to the integration calculation unit. It can be understood that the dot product operation of the integration calculation unit generates a cumulative weighting coefficient for temperature and a cumulative weighting coefficient for illumination for each sample. The cumulative output unit sums these coefficients and outputs the acidity response integral value by combining them with the acidity change. Optionally, the acidity change is taken from the difference of the comprehensive acidity feature values ​​calculated in the time-series segmentation stage, and the temperature change trend and the illumination change trend are calculated based on the data sequence of the stable segment. In a specific implementation, the quantification results of the environmental accumulation stage are used for processing in the subsequent anomaly detection stage, and the acidity response integral value is used as one of the input parameters for screening anomaly points.

[0073] See Figure 5 This paper demonstrates the data processing effects and analysis results of the time-series segmentation and environmental accumulation stages. The time-series segmentation stage arranges the continuously collected comprehensive acidity characteristic value sequence in chronological order. By calculating the acidity change rate between adjacent samples, the entire time series is divided into stable and variable segments based on preset thresholds. The stable segment represents the detection period when oil acidity is relatively stable, while the variable segment identifies the time points when acidity changes significantly. The environmental accumulation stage conducts in-depth analysis of the stable segment, extracting the instantaneous change trends of temperature and illumination sequences, and calculating the cumulative weighting coefficient of environmental factors on acidity changes through dot product operations. The chart uses a dual Y-axis format: the primary axis displays the trajectory of comprehensive acidity characteristic value changes, and the secondary axis displays the quantitative results of the environmental accumulation effect. Different colored markers clearly distinguish the sample distribution of the stable and variable segments, and the environmental accumulation curve reflects the continuous impact of environmental factors on oil acidity over time. This analysis method can effectively identify abnormal fluctuation patterns in oil acidity, providing important data support for subsequent anomaly detection.

[0074] Example 5: In specific implementation, the anomaly determination stage includes a preliminary scanning unit, a verification logic unit, and a result transmission unit. The preliminary scanning unit checks the acidity response integral value output by the environmental accumulation stage and selects samples with integral values ​​exceeding the average baseline and located in the variation range as candidate anomalies. The verification logic unit checks whether the temperature change trend and light change trend of each candidate anomaly simultaneously exceed the fluctuation range and checks whether the acidity change rate is continuously abnormal. Points that pass the test are included in the verified anomaly point set. The result transmission unit transmits the verified anomaly point set along with timestamps and environmental parameters to the next stage. The result synthesis stage includes a data collection unit, a risk calculation unit, and a report compilation unit. The data collection unit receives the verified anomaly point set output by the anomaly determination stage, extracts the sample identifier, collection time, ambient temperature, and light intensity of each anomaly point. The risk calculation unit calculates the risk score of each anomaly point based on the acidity response integral value and the environmental fluctuation amplitude, classifies the risk level according to the risk score, and the report compilation unit formats the risk sample list, risk level, and time interval label into a table structure and outputs the final test report. In some embodiments, the risk score is calculated using the following formula:

[0075]

[0076] in: Indicates the risk score. This represents the integral value of the acidity response. Indicates the magnitude of environmental fluctuations. and This represents a predefined weighting coefficient. It can be understood that the verification logic unit checks whether the temperature and light intensity change trends exceed the fluctuation range by comparing the trend value with a preset threshold, and whether the acidity change rate is continuously abnormal is determined by checking whether the acidity change rate of consecutive samples all exceed the threshold. Optionally, the sample identifier extracted by the data collection unit is a string or number sequence that uniquely identifies each anomaly point; the acquisition time is the timestamp recorded by the image sensor; the ambient temperature is the reading of the temperature probe; and the light intensity is the reading of the photometer. In some embodiments, the table structure formatted by the report compilation unit includes column headers and row data. The column headers correspond to fields in the anomaly sample list, and the row data corresponds to the specific information of each verified anomaly point. It can be understood that the risk calculation unit classifies risk levels based on a comparison of the risk score with a preset score range; for example, risk scores falling into different intervals correspond to different risk levels. Optionally, the average benchmark used by the preliminary scanning unit is the arithmetic mean or moving average of the acidity response integral value sequence, and the variation segment information comes from the output of the time-series segmentation stage.

[0077] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or apparatus.

[0078] Although embodiments of the invention have been shown and described, it will be understood by those skilled in the art that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the appended claims and their equivalents.

Claims

1. A machine vision-based full-automatic oil acidity detection system, characterized in that, The operation of the system is based on the following sequential processing links: The initial acquisition link captures the digital image of the oil sample through the image sensor and records the acquisition time, and at the same time, the temperature reading and the illumination intensity reading corresponding to the sample are obtained through the environmental sensor, and the image data and the environmental data are aligned and fused in time sequence; The feature conversion link receives the output data of the initial acquisition link, parses the color distribution feature and the light transmission rate feature from the digital image, performs normalization calculation combined with the temperature reading and the illumination intensity reading, and outputs the comprehensive acidity feature value; The time sequence segmentation link processes the comprehensive acidity feature value sequence generated by the feature conversion link, arranges the samples in the order of acquisition time, calculates the acidity change rate between adjacent samples, and divides the sequence into stable sections and variant sections according to the preset threshold; The environmental accumulation link analyzes the influence of temperature change trend and illumination change trend on acidity feature for the stable section identified by the time sequence segmentation link, and quantifies the cumulative effect of environmental factors through integral operation; The abnormality judgment link scans the output results of the environmental accumulation link, filters the acidity abnormal points combined with the variant section information, and performs multiple condition verification; The result synthesis link integrates the abnormal points after verification of the abnormality judgment link, and generates a final detection report.

2. The machine vision-based full-automatic oil acidity detection system according to claim 1, characterized in that, The output data of the initial acquisition link includes time-stamped image matrix, temperature data stream and illumination data stream, the output data of the feature conversion link includes color channel mean vector, light transmission rate gray value, temperature normalization factor and illumination normalization factor, the division result of the time sequence segmentation link includes stable section start and end markers, variant section start and end markers and acidity change rate sequence, the quantification result of the environmental accumulation link includes temperature accumulation weight coefficient, illumination accumulation weight coefficient and acidity response integral value, the abnormal points after verification of the abnormality judgment link include abnormal time point, environmental fluctuation amplitude and acidity deviation index, and the final detection report of the result synthesis link includes abnormal sample list, risk level classification and time interval label. 3.The machine vision-based full-automatic oil acidity detection system according to claim 1, characterized in that, The initial acquisition link includes: The image capture unit uses a high-resolution digital camera to take color images of the oil sample and adds millisecond-level time markers; The environmental monitoring unit collects the ambient temperature value and the illumination intensity value around the sample in real time through the temperature probe and the luminometer; The data synchronization unit receives the image data output by the image capture unit and the environmental data output by the environmental monitoring unit, synchronizes the two types of data to a unified time axis using a time matching algorithm, and generates a time-aligned data package.

4. The machine vision-based full-automatic oil acidity detection system according to claim 1, characterized in that, The feature conversion link includes: The image analysis unit analyzes the digital image output by the initial acquisition link, calculates the average intensity of the red component, green component and blue component as the color distribution feature, and calculates the average gray value of the center region of the image as the light transmission rate feature; The environmental adjustment unit extracts the temperature reading and the illumination intensity reading output by the initial acquisition link, performs minimum-maximum normalization processing on the temperature data, and performs standard deviation normalization processing on the illumination data, to generate temperature normalization factor and illumination normalization factor; The feature fusion unit linearly combines the color distribution feature and the transmittance feature of the image analysis unit with the temperature normalization factor and the illumination normalization factor of the environment adjustment unit, and outputs a comprehensive acidity feature value.

5. The machine vision-based full-automatic oil acidity detection system according to claim 1, characterized in that, The time sequence segmentation link comprises: The sequence arrangement unit obtains the comprehensive acidity feature value sequence output by the feature conversion link, sorts the sequence in ascending order according to the collection time stamp, and generates a time sequence; The change rate calculation unit traverses the time sequence, calculates the ratio of the difference between the comprehensive acidity feature values of each two consecutive samples to the time interval as the acidity change rate, and outputs the time sequence and the acidity change rate sequence; The segment marking unit compares the absolute value of each acidity change rate with a preset threshold, marks the consecutive samples below the threshold as stable segments, and marks the samples above the threshold as variation segments.

6. The machine vision-based full-automatic oil acidity detection system according to claim 1, characterized in that, The environment accumulation link comprises: The trend analysis unit extracts the temperature data sequence and the illumination data sequence for the stable segments identified by the time sequence segmentation link, calculates the instantaneous change rate of the temperature sequence as the temperature change trend, and calculates the instantaneous change rate of the illumination sequence as the illumination change trend; The integral calculation unit point-multiplies the temperature change trend and the illumination change trend with the acidity change amount of the corresponding sample respectively to obtain the temperature accumulation weight coefficient and the illumination accumulation weight coefficient; The accumulation output unit accumulates the temperature accumulation weight coefficient and the illumination accumulation weight coefficient of each sample, and calculates the acidity response integral value in combination with the acidity change amount.

7. The machine vision-based full-automatic oil acidity detection system according to claim 1, characterized in that, The anomaly judgment link comprises: The preliminary scanning unit checks the acidity response integral value output by the environment accumulation link, selects the sample whose integral value exceeds the average benchmark and is located in the variation segment as a candidate abnormal point; The verification logic unit checks whether the temperature change trend and the illumination change trend of each candidate abnormal point simultaneously exceed the fluctuation range, and checks whether the acidity change rate is continuously abnormal, and the points passing the check are included in the verified abnormal point set; The result delivery unit delivers the verified abnormal point set together with the time stamp and the environmental parameters to the next link. 8.The machine vision-based full-automatic oil acidity detection system according to claim 1, characterized in that, The result synthesis link comprises: The data collection unit receives the verified abnormal point set output by the anomaly judgment link, extracts the sample identifier, the collection time, the environmental temperature and the illumination intensity of each abnormal point; The risk calculation unit calculates the risk score of each abnormal point based on the acidity response integral value and the environmental fluctuation amplitude, and divides the risk level according to the risk score; The report preparation unit formats the risk sample list, the risk level and the time interval label into a table structure, and outputs the final detection report. 9.The machine vision-based full-automatic oil acidity detection system according to claim 3, characterized in that, The image capture unit comprises: The illumination management sub-unit adjusts the brightness and angle of the light source around the camera to ensure uniform distribution of illumination during image acquisition; The image acquisition sub-unit controls the focal length and exposure time of the camera to capture high-definition color images; The time marking sub-unit adds a collection time mark accurate to milliseconds to each image.

10. The machine vision-based full-automatic oil acidity detection system according to claim 4, characterized in that, The image analysis unit comprises: The color extraction sub-unit separates the red channel, green channel and blue channel of the digitized image, and calculates the average value of the pixel values of each channel; The transmittance calculation sub-unit selects a central rectangular region of the image, and calculates the average gray value of the pixels in the region; The feature output sub-unit combines the color channel average value and the transmittance gray value into a feature vector.

Citation Information

Patent Citations

  • Oil inspection and analysis system based on machine vision and image processing

    CN116128794A

  • Grease detection data analysis system and method based on multi-source data

    CN120214239A