Oil product quality detection method
By employing multi-scale wavelet texture analysis and energy entropy feature extraction, the problem of delayed early warning of lubricating oil in wind turbine generators was solved, enabling accurate detection and early warning of lubricating oil quality. This improved the accuracy and stability of detection and is suitable for online monitoring of wind farms.
Patent Information
- Application Number
- CN202511534479.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-27
- Publication Date
- 2026-01-30
AI Technical Summary
Existing technologies struggle to capture the microscopic texture changes of wind turbine gearbox lubricating oil in low-temperature and high-humidity environments using traditional methods, resulting in delayed early aging warnings and an inability to provide timely and accurate predictive maintenance decisions for equipment.
By employing multi-scale wavelet texture analysis and energy entropy feature extraction methods, and through image acquisition, preprocessing, feature extraction, and quality assessment, a support vector machine classifier is used to automatically determine the quality grade of lubricating oil, thereby achieving accurate quantification of the micro-texture changes of lubricating oil.
It improves the accuracy of lubricant quality testing and early warning capabilities, reduces human error, ensures the stability and consistency of test results, and achieves non-destructive, real-time online monitoring, reducing labor costs and environmental interference risks.
Smart Images

Figure CN121437418A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of oil product testing technology, and in particular relates to a method for testing oil product quality. Background Technology
[0002] In monitoring the quality of lubricating oil in wind turbine gearboxes, existing technologies primarily rely on analyzing macroscopic physicochemical parameters such as oil color, transparency, and dielectric constant. However, under harsh environmental conditions of low temperature and high humidity, the early stages of lubricating oil aging often manifest as the precipitation of microbubbles and the aggregation of suspended particles at the microscale, forming specific texture characteristics. These subtle texture changes are difficult to effectively capture and quantify using traditional color observation or turbidity measurement methods, resulting in a significant lag in early warning of oil degradation and failing to provide timely and accurate decision-making basis for predictive maintenance of equipment. Therefore, the following solutions are proposed to address these issues. Summary of the Invention
[0003] The purpose of this invention is to provide an oil quality detection method. By introducing multi-scale wavelet texture analysis and energy entropy feature extraction, the method can accurately quantify the texture changes of lubricating oil at the microscale. This solves the problem that existing technologies rely on macroscopic parameter analysis, which cannot effectively capture the subtle texture features caused by early aging of lubricating oil under low temperature and high humidity conditions, thus causing serious delays in early warning.
[0004] To solve the above-mentioned technical problems, the present invention is achieved through the following technical solution:
[0005] This invention relates to a method for testing the quality of oil products, the method comprising the following steps:
[0006] Step S1, Image Acquisition: In the low temperature and high humidity environment of the wind turbine gearbox, a dedicated camera is used to acquire static images of the lubricating oil sample;
[0007] Step S2, Image Preprocessing: Convert the color image to grayscale, and perform filtering, noise reduction, and contrast enhancement to optimize image quality;
[0008] Step S3, Feature Extraction: Perform multi-scale wavelet transform on the processed image and calculate its energy entropy, which is used as the core feature for quantifying the changes in oil texture;
[0009] Step S4, Quality Assessment: Input the calculated energy entropy features into the pre-trained classification model to automatically determine the quality grade of the lubricating oil;
[0010] Step S5, Result Output: Display the detection results and alarm information to the user, and store all relevant data for query and analysis.
[0011] Further, in step S1, image acquisition specifically involves: at the lubricating oil sampling point of the wind turbine gearbox, using an industrial CCD camera equipped with a ring LED light source to acquire a static image of the lubricating oil sample; the camera is set to autofocus, the light source is a white LED, and the light intensity is adjusted to 500 lux to eliminate glare interference; the image is stored in RGB format, and the sampling time, location, and environmental parameters are marked.
[0012] Furthermore, step S2, image preprocessing, specifically includes the following steps:
[0013] Step S21: Convert the acquired RGB image to a grayscale image, and calculate the grayscale value using a weighted average method.
[0014]
[0015] In the formula, This refers to the grayscale value of a specific pixel in the converted grayscale image. This represents the pixel intensity value of the same pixel in the red channel of the original RGB color image. This represents the pixel intensity value of the same pixel in the green channel of the original RGB color image. This represents the pixel intensity value of the same pixel in the blue channel of the original RGB color image. All are weighted coefficients;
[0016] Step S22: Apply Gaussian filtering to the grayscale image for noise removal. The Gaussian kernel size is 5x5 pixels, and the standard deviation is [missing value]. The filtering formula is:
[0017]
[0018] In the formula, This represents the output pixel value of the filtered image at coordinates (x, y). These are the two-dimensional coordinates of pixels in the image. , For loop variable, The input pixel value of the original grayscale image at coordinates (x+i, y+j). Let be the Gaussian kernel function value at offset (i,j);
[0019] Step S23: Use histogram equalization to enhance image contrast and redistribute pixel intensity to make the grayscale histogram uniformly distributed.
[0020] Furthermore, step S3, feature extraction, specifically includes the following steps:
[0021] Step S31: Perform two-dimensional discrete wavelet transform on the preprocessed grayscale image, using the Daubechies wavelet basis, decompose the image into 3 levels, and obtain multiple wavelet subbands.
[0022] Step S32: For each sub-band, calculate its energy value. The energy calculation formula is as follows:
[0023]
[0024] In the formula, Here, k represents the energy value of the k-th wavelet subband; k is the subband index. These are the width and height of the k-th sub-band image, respectively; Let be the wavelet coefficient of the k-th sub-band at coordinates (x, y);
[0025] Step S33: Calculate the total energy of all subbands:
[0026]
[0027] In the formula, The sum of the energies of all wavelet subbands. This represents the total number of subbands generated after wavelet decomposition.
[0028] Calculate the energy probability of each subband:
[0029] Calculate energy entropy as a core feature characterizing changes in lubricating oil texture:
[0030]
[0031] In the formula, To calculate the energy entropy, Let be the energy probability of the k-th subband.
[0032] Furthermore, step S4, the quality assessment, specifically includes the following steps:
[0033] Step S41: Input the extracted energy entropy features into a pre-trained support vector machine (SVM) classifier, which obtains kernel parameters and penalty parameters for optimizing its classification performance by training on historical lubricating oil image data;
[0034] Step S42: The SVM classifier outputs the lubricating oil quality grade, including three grades: normal, warning, and need replacement. The classification decision function is:
[0035]
[0036] In the formula, Let SVM be the decision function of the classifier; The energy entropy characteristic value of the lubricating oil sample to be classified; This is a sign function that returns +1 or -1 depending on the sign of the result within the parentheses, corresponding to different quality levels; For support vector indexing; This represents the total number of support vectors. Let be the Lagrange multiplier of the i-th support vector in the model; Let be the true class label of the i-th support vector in the training set; These are parameters of the RBF kernel function, used to control the range of influence of a single sample; For bias terms; Features for training samples.
[0037] Furthermore, step S5, the result output, specifically includes the following steps:
[0038] Step S51: Display the quality level on the user interface, including visual reports and alerts;
[0039] Step S52: Store the detection results in the database, record the timestamp, image ID, environmental parameters, energy entropy value and quality level, and generate a detection log for subsequent analysis.
[0040] The present invention has the following beneficial effects:
[0041] 1. This invention analyzes the texture energy distribution characteristics of lubricating oil images in a specific wavelet domain, enabling it to capture microscopic structural changes caused by aging that are difficult for the human eye to discern, such as the distribution patterns of tiny bubbles or the aggregation morphology of suspended particles. This sensitivity to subtle texture changes allows the system to identify initial signs of oil degradation earlier and more accurately, thereby improving the accuracy of quality detection and early warning capabilities. Compared to traditional methods that rely on macroscopic physical quantities such as color or turbidity, this method provides a deeper insight into the internal state of oil from the perspective of texture information entropy, avoiding misjudgments that may result from apparent similarity.
[0042] 2. The energy entropy feature upon which this invention relies is calculated based on the inherent statistical characteristics of the image signal after wavelet transform. It has natural robustness to slight fluctuations in light intensity, inherent differences in sample color, and random noise introduced by camera acquisition. This enables the detection system to maintain stable performance in real industrial environments such as wind farm gearboxes and is not easily affected by changes in external conditions. The feature extraction process focuses on texture information strongly correlated with aging while filtering out many irrelevant interferences, ensuring the consistency and reliability of the results when detection is carried out at different times and on different devices.
[0043] 3. This invention extracts complex image information into quantifiable energy entropy feature values. These numerical features facilitate rapid and accurate comparison and decision-making with preset thresholds or machine learning models. The entire process does not rely on visual judgment by experienced professionals, reducing the impact of human subjectivity on the detection results, while improving detection efficiency and reducing labor costs.
[0044] 4. This invention completes the detection through non-contact image acquisition and analysis. This method completely avoids direct physical contact with lubricating oil samples, eliminating the risks of sample contamination, reagent consumption, or cross-infection that may exist in traditional chemical analysis or sampling and testing processes. The entire evaluation process does not cause any impact or loss to the oil itself, achieving non-destructive testing. This allows it to be integrated into online monitoring systems to perform real-time or periodic status screening of lubricating oil in operating equipment, providing timely and continuous data support for predictive maintenance, thereby effectively preventing equipment failures caused by oil failure.
[0045] Of course, any product implementing this invention does not necessarily need to achieve all of the advantages described above at the same time. Attached Figure Description
[0046] To more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0047] Figure 1 This is a flowchart illustrating a method for testing oil quality according to the present invention. Detailed Implementation
[0048] 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.
[0049] Please see Figure 1 As shown, this invention is a method for testing the quality of oil products. The testing method includes the following steps:
[0050] Step S1, Image Acquisition: In the low temperature and high humidity environment of the wind turbine gearbox, a dedicated camera is used to acquire static images of the lubricating oil sample;
[0051] Step S1, image acquisition specifically involves: at the lubricating oil sampling point of the wind turbine gearbox, using an industrial CCD camera equipped with a ring LED light source to acquire a static image of the lubricating oil sample; the camera is set to autofocus, the light source is a white LED, and the illumination intensity is adjusted to 500 lux to eliminate reflection interference; the image is stored in RGB format, and the sampling time, location, and environmental parameters are marked.
[0052] Step S2, Image Preprocessing: Convert the color image to grayscale, and perform filtering, noise reduction, and contrast enhancement to optimize image quality;
[0053] Step S2, image preprocessing specifically includes the following steps:
[0054] Step S21: Convert the acquired RGB image to a grayscale image, and calculate the grayscale value using a weighted average method.
[0055]
[0056] In the formula, This refers to the grayscale value of a specific pixel in the converted grayscale image. This represents the pixel intensity value of the same pixel in the red channel of the original RGB color image. This represents the pixel intensity value of the same pixel in the green channel of the original RGB color image. This represents the pixel intensity value of the same pixel in the blue channel of the original RGB color image. All are weighted coefficients;
[0057] Step S22: Apply Gaussian filtering to the grayscale image for noise removal. The Gaussian kernel size is 5x5 pixels, and the standard deviation is [missing value]. The filtering formula is:
[0058]
[0059] In the formula, This represents the output pixel value of the filtered image at coordinates (x, y). These are the two-dimensional coordinates of pixels in the image. , For loop variable, The input pixel value of the original grayscale image at coordinates (x+i, y+j). Let be the Gaussian kernel function value at offset (i,j);
[0060] Step S23: Use histogram equalization to enhance image contrast and redistribute pixel intensity to make the grayscale histogram uniformly distributed.
[0061] Step S3, Feature Extraction: Perform multi-scale wavelet transform on the processed image and calculate its energy entropy, which is used as the core feature for quantifying the changes in oil texture;
[0062] Step S3, feature extraction specifically includes the following steps:
[0063] Step S31: Perform two-dimensional discrete wavelet transform on the preprocessed grayscale image, using the Daubechies wavelet basis, decompose the image into 3 levels, and obtain multiple wavelet subbands.
[0064] Step S32: For each sub-band, calculate its energy value. The energy calculation formula is as follows:
[0065]
[0066] In the formula, Here, k represents the energy value of the k-th wavelet subband; k is the subband index. These are the width and height of the k-th sub-band image, respectively; Let be the wavelet coefficient of the k-th sub-band at coordinates (x, y);
[0067] Step S33: Calculate the total energy of all subbands:
[0068]
[0069] In the formula, The sum of the energies of all wavelet subbands. This represents the total number of subbands generated after wavelet decomposition.
[0070] Calculate the energy probability of each subband:
[0071] Calculate energy entropy as a core feature characterizing changes in lubricating oil texture:
[0072]
[0073] In the formula, To calculate the energy entropy, Let be the energy probability of the k-th subband.
[0074] Step S4, Quality Assessment: Input the calculated energy entropy features into the pre-trained classification model to automatically determine the quality grade of the lubricating oil;
[0075] Step S4, the quality assessment specifically includes the following steps:
[0076] Step S41: Input the extracted energy entropy features into a pre-trained support vector machine (SVM) classifier, which uses a radial basis function (RBF) kernel with kernel parameters... and penalty parameters By using optimization algorithms such as cross-validation and grid search, training and selection are performed based on historical lubricating oil image data to achieve the best classification performance;
[0077] Step S42: The SVM classifier outputs the lubricating oil quality grade, including three grades: normal, warning, and need replacement. The classification decision function is:
[0078]
[0079] In the formula, Let SVM be the decision function of the classifier; The energy entropy characteristic value of the lubricating oil sample to be classified; This is a sign function that returns +1 or -1 depending on the sign of the result within the parentheses, corresponding to different quality levels; For support vector indexing; This represents the total number of support vectors. Let be the Lagrange multiplier of the i-th support vector in the model; Let be the true class label of the i-th support vector in the training set; These are parameters of the RBF kernel function, used to control the range of influence of a single sample; For bias terms; Features for training samples.
[0080] Step S5, Result Output: Display the detection results and alarm information to the user, and store all relevant data for query and analysis.
[0081] Step S5, the result output specifically includes the following steps:
[0082] Step S51: Display the quality level on the user interface, including visual reports and alerts;
[0083] Step S52: Store the detection results in the database, record the timestamp, image ID, environmental parameters, energy entropy value and quality level, and generate a detection log for subsequent analysis.
[0084] One specific application of this embodiment is:
[0085] Background and Scenario: This embodiment is applied to a coastal wind power plant, where the ambient temperature is 3°C. The relative humidity is 85%. One of the wind turbine generators in the wind farm, model WTG-2.5MW, has been running continuously for about 8,000 hours. According to the maintenance plan, the quality of its gearbox lubricating oil needs to be sampled and inspected.
[0086] Implementation steps:
[0087] S1, Image Acquisition
[0088] The operator extracted approximately 50 ml of lubricating oil sample from the target gearbox and added it onto a standard glass slide, forming a uniform oil film. The slide was then placed on the camera's imaging platform. The ambient conditions were ensured to be at a temperature of 3... The humidity was 85%. The camera focus was adjusted to ensure the oil film area was clearly imaged in the center of the frame. The ring LED light source was turned on, and the light intensity was precisely adjusted to 500 lux to eliminate any specular reflections that might occur on the oil film surface. Subsequently, the camera was triggered to capture a still RGB image, which was stored as "WTG-2.5MW_20231027_103000.jpg" and automatically recorded the timestamp, device ID, and temperature and humidity parameters.
[0089] S2, Image Preprocessing
[0090] The industrial computer reads the acquired RGB image. First, it converts it to a grayscale image using the following formula:
[0091]
[0092] in, These represent the intensity values of the pixels in the original image in the red, green, and blue channels, respectively.
[0093] Next, a Gaussian filter is applied to the grayscale image to suppress noise. A 5x5 pixel Gaussian kernel with a standard deviation of [missing information] is used. The filtering operation is represented as:
[0094]
[0095] in, It is a Gaussian kernel function;
[0096] Finally, histogram equalization is performed on the filtered image to enhance the contrast of tiny bubbles and particles in the oil film image.
[0097] S3, Feature Extraction
[0098] Preprocessed image Two-dimensional discrete wavelet transform is performed; the Daubechies 4 (db4) wavelet basis is used to perform a 3-level decomposition, resulting in a total of 10 sub-band images including approximation coefficients and detail coefficients.
[0099] Calculate the energy of each subband. For the _ ... Individual bands, their energy The calculation formula is:
[0100]
[0101] in, Is the sub-band in position? The wavelet coefficients at the specified location, where M and N are the dimensions of the subband.
[0102] Calculate the total energy of all subbands:
[0103]
[0104] Then, the probability of each subband's energy in the total energy is calculated:
[0105]
[0106] Finally, the energy entropy, which characterizes the complexity and non-uniformity of the lubricating oil texture, is calculated. :
[0107]
[0108] In this embodiment, the calculated energy entropy value .
[0109] S4, Quality Assessment
[0110] The calculated energy entropy characteristics The data is input into a pre-trained Support Vector Machine (SVM) classification model; this model is trained using historical data and employs a Radial Basis Function (RBF) kernel with specific kernel parameters. Penalty parameters .
[0111] The decision function of the classification model is:
[0112]
[0113] in, These are the parameters determined after model training. Based on the output of this function, the classifier classifies the current oil quality as "warning." This indicates that the lubricating oil has aged to some extent. Although it can continue to be used for a short period, it requires closer monitoring and should be replaced at the next maintenance.
[0114] S5. Result Output
[0115] The test results are immediately displayed on the industrial computer screen. The interface clearly shows: "Test Result: Warning - Enhanced monitoring recommended"; at the same time, all data from this test, including image ID, timestamp, environmental parameters, energy entropy value of 2.15, and quality level "Warning", are automatically stored in the system database, and a test report document containing all the above information is generated for maintenance personnel to review and archive.
[0116] In the description of this specification, references to terms such as "an embodiment," "example," "specific example," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of the invention. In this specification, illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples.
[0117] The preferred embodiments of the present invention disclosed above are merely illustrative of the invention. These preferred embodiments do not exhaustively describe all details, nor do they limit the invention to the specific implementations described. Clearly, many modifications and variations can be made based on the content of this specification. This specification selects and specifically describes these embodiments to better explain the principles and practical applications of the invention, thereby enabling those skilled in the art to better understand and utilize the invention. The invention is limited only by the claims and their full scope and equivalents.
Claims
1. A method for testing the quality of oil products, characterized in that, The detection method includes the following steps: Step S1, Image Acquisition: Use a camera to acquire static images of the lubricating oil sample; Step S2, Image Preprocessing: Convert the color image to grayscale, and perform filtering, noise reduction, and contrast enhancement; Step S3, Feature Extraction: Perform multi-scale wavelet transform on the processed image and calculate its energy entropy to quantify the texture changes of lubricating oil at the microscale. Step S4, Quality Assessment: Input the calculated energy entropy features into the pre-trained classification model to automatically determine the quality grade of the lubricating oil; Step S5, Result Output: Display the detection results and alarm information to the user, and store all relevant data for query and analysis.
2. The method for detecting oil quality according to claim 1, characterized in that, Step S1, image acquisition, specifically involves: at the lubricating oil sampling point of the generator set gearbox, using an industrial CCD camera equipped with a ring LED light source to acquire a static image of the lubricating oil sample; the camera is set to autofocus, the light source is a white LED, and the light intensity is adjusted to 500 lux to eliminate glare interference; the image is stored in RGB format, and the sampling time, location, and environmental parameters are marked.
3. The method for detecting oil quality according to claim 1, characterized in that, Step S2, image preprocessing, specifically includes the following steps: Step S21: Convert the acquired RGB image to a grayscale image, and calculate the grayscale value using a weighted average method. In the formula, This refers to the grayscale value of a specific pixel in the converted grayscale image. This represents the pixel intensity value of the same pixel in the red channel of the original RGB color image. This represents the pixel intensity value of the same pixel in the green channel of the original RGB color image. This represents the pixel intensity value of the same pixel in the blue channel of the original RGB color image. All are weighted coefficients; Step S22: Apply Gaussian filtering to the grayscale image for noise removal. The Gaussian kernel size is 5x5 pixels, and the standard deviation is [missing value]. The filtering formula is: In the formula, This represents the output pixel value of the filtered image at coordinates (x, y). These are the two-dimensional coordinates of pixels in the image. , For loop variable, The input pixel value of the original grayscale image at coordinates (x+i, y+j). Let be the Gaussian kernel function value at offset (i,j); Step S23: Use histogram equalization to enhance image contrast and redistribute pixel intensity to make the grayscale histogram uniformly distributed.
4. The method for detecting oil quality according to claim 1, characterized in that, Step S3, feature extraction, specifically includes the following steps: Step S31: Perform two-dimensional discrete wavelet transform on the preprocessed grayscale image, using the Daubechies wavelet basis, decompose the image into 3 levels, and obtain multiple wavelet subbands. Step S32: For each sub-band, calculate its energy value. The energy calculation formula is as follows: In the formula, Here, k represents the energy value of the k-th wavelet subband; k is the subband index. These are the width and height of the k-th sub-band image, respectively; Let be the wavelet coefficient of the k-th sub-band at coordinates (x, y); Step S33: Calculate the total energy of all subbands: In the formula, The sum of the energies of all wavelet subbands. This represents the total number of subbands generated after wavelet decomposition. Calculate the energy probability of each subband: Calculate energy entropy as a core feature characterizing changes in lubricating oil texture: In the formula, To calculate the energy entropy, Let be the energy probability of the k-th subband.
5. The method for detecting oil quality according to claim 1, characterized in that, Step S4, the quality assessment, specifically includes the following steps: Step S41: Input the extracted energy entropy features into a pre-trained support vector machine classifier. The classifier is trained on historical lubricating oil image data to obtain kernel parameters and penalty parameters for optimizing its classification performance. Step S42: The SVM classifier outputs the lubricating oil quality grade, including three grades: normal, warning, and need replacement. The classification decision function is: In the formula, Let SVM be the decision function of the classifier; The energy entropy characteristic value of the lubricating oil sample to be classified; This is a sign function that returns +1 or -1 depending on the sign of the result within the parentheses, corresponding to different quality levels; For support vector indexing; This represents the total number of support vectors. Let be the Lagrange multiplier of the i-th support vector in the model; Let be the true class label of the i-th support vector in the training set; These are parameters of the RBF kernel function, used to control the range of influence of a single sample; For bias terms; Features for training samples.
6. The method for detecting oil quality according to claim 1, characterized in that, Step S5, the result output specifically includes the following steps: Step S51: Display the quality level on the user interface, including visual reports and alerts; Step S52: Store the detection results in the database, record the timestamp, image ID, environmental parameters, energy entropy value and quality level, and generate a detection log for subsequent analysis.
Citation Information
Patent Citations
Ferrogram image intelligent identification method based on support vector machine
CN112288000A
Online monitoring and early warning method and system for oil particles
CN117058414A
Quality analysis method and system for low-carbon lubricating oil
CN117723739A
Textile quality detection method fusing multi-scale features
CN119444670A