Automobile engine carbon deposition degree discrimination method based on endoscopic imaging

Through adaptive histogram equalization and bilateral filtering processing technology, combined with Resnet18 network structure and self-attention mechanism, the problem of low illumination and overexposure noise in endoscope collected images is solved, and the accuracy of identifying the degree of carbon deposition in automobile engines is improved. Achieving more efficient carbon deposition detection.

CN118537636AActive Publication Date: 2024-08-23ZHONGBEI UNIV

Patent Information

Application Number
CN202410604271.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-05-15
Publication Date
2024-08-23
Estimated Expiration
2044-05-15

Smart Images

  • Figure CN118537636A
    Figure CN118537636A
Patent Text Reader

Abstract

The invention discloses an automobile engine carbon deposition degree discrimination method based on endoscopic imaging, and belongs to the technical field of automobile detection. Aiming at the problems of low illumination, overexposure, chromaticity noise and the like of an image caused by interference of random postures of an endoscope, an algorithm with high recognition rate and good compatibility does not exist in intelligent judgment at present, and traditional manual judgment is replaced by model judgment based on deep learning, so that the recognition efficiency is improved. The efficiency and the accuracy of judging the carbon deposition degree of the automobile engine are effectively improved; the problems of low illumination, overexposure, chrominance noise and the like in the image are solved by adopting a processing mode of adaptive histogram equalization and bilateral filtering; resnet18 is improved by adding a self-adaptive pooling kernel, a deformable convolution module and a self-attention mechanism module, and the comprehensive performance of a carbon deposition degree discrimination model is improved. According to tests on three types of engines, the recognition accuracy of the method is improved to 87.1% from 80.0%, which shows that the method is good in compatibility and beneficial to popularization.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the technical field of automobile detection, and in particular relates to a method for determining the degree of carbon deposit in an automobile engine based on endoscopic imaging. Background Art

[0002] Impurities in automobile fuel will not be fully burned under high temperature and high pressure, which will produce colloids that accumulate on the surface of various parts of the engine to form carbon deposits. The long-term accumulation of carbon deposits will cause the car to have unstable idling speed, increased fuel consumption and other problems, thus affecting the performance of the car. Effective carbon deposit cleaning methods can reduce the impact of carbon deposits on car performance and extend the service life of the car. At present, the choice of cleaning or not is mainly based on the experience of the inspectors and the subjective will of the driver, which will lead to excessive cleaning or inadequate cleaning, increase the cleaning cost, so it is necessary to accurately judge the severity of carbon deposits in the car engine in order to provide reasonable cleaning suggestions and feedback on the effect after cleaning. Shenzhen Jieyi Testing Service Co., Ltd. CN202110661929.9 proposes to extend the endoscope into the engine to collect images, and then observe with the human eye or make intelligent judgments to provide intuitive visual basis for the determination of the degree of carbon deposits. However, this manual judgment method is prone to misjudgment and is inefficient, which affects its promotion and application. Hu Binyu (DOI: 10.27470 / d.cnki.ghbgc.2020.000380) used GPU parallelism to speed up the training of the model, but did not conduct targeted research on improving the recognition accuracy. Tang Yuanzhi et al. CN112819783B used a panoramic image acquisition device to collect panoramic images of the engine in real time, and compared the difference with the pre-stored carbon-free background image to obtain the degree of carbon deposit contamination. This method is more effective for surface detection with high flatness, but it is not suitable for detection of multiple parts inside the engine. Due to the interference of the random posture of the endoscope, the image has problems such as low illumination, overexposure and chromatic noise. There is currently no algorithm with high recognition rate and good compatibility for intelligent judgment. Summary of the invention

[0003] The interference of random posture of the endoscope may cause low illumination, overexposure and chromatic noise in the image. There is currently no intelligent judgment algorithm with high recognition rate and good compatibility. The present invention provides a method for judging the degree of carbon deposit in automobile engines based on endoscopic imaging.

[0004] In order to achieve the above object, the present invention adopts the following technical solutions:

[0005] Step 1: Use endoscope equipment to collect original images of five parts of the automobile engine: the fuel injector, intake duct, intake valve, cylinder wall, and piston top, and construct the original data set A. For each image A in the original data set A, i Carry out carbon deposition classification labeling in sequence;

[0006] The specific operation of constructing the original data set A is as follows: collect N images for each part of the same type of vehicle, N ≥ 2500, then the number of original data sets A is 5N; the marked carbon deposit levels are divided into five levels: slight, mild, moderate, severe, and serious.

[0007] Step 2: For each image A in the original dataset A i Adaptive histogram equalization and bilateral filtering are performed in sequence to obtain the preprocessed data set C; where:

[0008] The specific operation of adaptive histogram equalization is as follows: First, each image A in the original data set A i Divide into M of equal size i ≥ 4 sub-blocks, calculate the histogram h of each sub-block i,j (x)(i=1,...,5N;j=1,...,M), x represents the gray level, and its value range is [0,L i,j -1], L i,j ≤255 is the possible number of gray levels; then calculate the histogram h i,j Clipping threshold (x) Where n is the contrast limiting factor, n>0, with H i,j is the threshold clipping h i,j (x), evenly distribute the cut pixels to the histogram h i,j In each gray level of (x), each sub-block is repeatedly allocated, and the reallocated histogram h i,j (x) Perform histogram equalization, and the equalization result is f i.j (x); finally, according to the equilibrium result f i.j (x) Get the gray value of the central pixel of each sub-block and use bilinear interpolation to calculate the gray value of image A. i The grayscale values ​​of each point in the image are reconstructed to obtain the equalized image B. i ;

[0009] The specific operation of bilateral filtering is: for the equalized image B i , through the formula The processed image C is obtained by calculation i , where B i (p,q) represents the input point, C i (u,v) is the output point, S i (u,v) is the range of (2R+1)(2R+1) centered at (u,v), R is the radius of the filter kernel, and w(u,v,p,q) is the spatial Gaussian function w s and the scaled Gaussian function w r The calculated value, that is, w = w s ·wr , where σ s is the spatial domain standard deviation, σ r is the standard deviation of the scale domain; all C i That is, a processed image set C is formed.

[0010] Step 3: Establish a carbon deposition degree discrimination model based on the Resnet18 network structure

[0011] Carbon deposition degree determination model It is composed of convolution block I, pooling layer I, convolution block II, convolution block III, convolution block IV, convolution block V, self-attention mechanism module, pooling layer II, dropout layer, and fully connected layer. Among them:

[0012] The convolution block I consists only of convolution layer Ia, the convolution kernel size of convolution layer Ia is 7×7, the step size is 2, the number of input channels is 3, the number of output channels is 64, and the output feature map size of convolution block I is 112×112;

[0013] The pooling layer I is an adaptive exponential pooling, which is calculated by the formula and Calculate the smooth approximate average value of the pooling core area P respectively and smooth approximate maximum where α k , α l is a single kernel vector, is the mean value of the pooling kernel area, l, k are pixel indices in the pooling kernel area; trainable weight mask β is then used to combine and Get the adaptive exponential pooling value of the pooling core area P The pooling kernel size is 3, the stride is 2, the number of input and output channels is 64, and the output feature map size is 56×56;

[0014] The convolution block II is formed by stacking and connecting convolution layer IIa, convolution layer IIb, convolution layer IIc, and convolution layer IId, wherein the convolution kernel size in convolution layer IIa, convolution layer IIb, convolution layer IIc, and convolution layer IId is 3×3, the step size is 1, the number of input and output channels is 64, and the output feature map size of convolution block II is 56×56;

[0015] The convolution block III includes convolution layer IIIa, convolution layer IIIb, convolution layer IIIc, convolution layer IIId, and convolution layer IIIe, wherein convolution layer IIIa, convolution layer IIIb, convolution layer IIId, and convolution layer IIIe are stacked and connected, and the convolution kernel size is 3×3. Convolution layer IIIc is a shortcut connection, connecting the input of convolution layer IIIa and the output of convolution layer IIIa, and the convolution kernel size is 1×1; the stride of convolution layer IIIa and convolution layer IIIc is 2, the number of input channels is 64, and the number of output channels is 128. The stride of convolution layer IIIb, convolution layer IIId, and convolution layer IIIe is 1, and the number of input and output channels is 128; the output feature map size of convolution block III is 28×28;

[0016] The convolution block IV comprises convolution layer IVa, convolution layer IVb, convolution layer IVc, convolution layer IVd, and convolution layer IVe, wherein convolution layer IVa, convolution layer IVb, convolution layer IVd, and convolution layer IVe are stacked and connected, and the convolution kernel size is 3×3; convolution layer IVc is a shortcut connection, connecting the input of convolution layer IVa and the output of convolution layer IVb, and the convolution kernel size is 1×1; the step size of convolution layer IVa and convolution layer IVc is 2, the number of input channels is 128, and the number of output channels is 256; the step size of convolution layer IVb, convolution layer IVd, and convolution layer IVe is 1, and the number of input and output channels is 256; the output feature map size of convolution block IV is 14×14;

[0017] The convolution block Va comprises convolution layers Va, Va, Va, Va, Va, Vad and Va, wherein the convolution layers Va, Va, Vad and Va are stacked and connected, and the convolution kernel size is 3×3; the convolution layer Va is a shortcut connection, and the convolution kernel size is 1×1, which connects the input of the convolution layer Va and the output of the convolution layer Va; the convolution layers Va and Va are connected in a stacked manner, and the convolution kernel size is 3×3; the convolution layer Va is a shortcut connection, and the convolution kernel size is 1×1, which connects the input of the convolution layer Va and the output of the convolution layer Va; the convolution layers Va and Va are connected in a stacked manner, and the convolution kernel size is 3×3; the convolution layer Va is connected in a stacked manner, and the convolution kernel size is 1×1; the convolution layer Va and the convolution layer Va are ... The stride of layer Ⅴc is 2, the number of input channels is 256, and the number of output channels is 512; the stride of convolution layer Ⅴd is 1, and the number of input and output channels is 512; convolution layer Ⅴb and convolution layer Ⅴe are deformable convolutions, which contain a padding layer and three convolution layers. The offset position and offset amplitude of the convolution kernel are adjusted through parallel convolution operations to obtain the offset domain and modulation scalar; the output feature map of convolution block V Size is 7×7;

[0018] The self-attention mechanism module includes a position attention module and a channel attention module; wherein the position attention module converts the output feature map of the convolution block V into The feature maps are generated through three conventional convolutional layers, and then reshaped to obtain the feature maps respectively. Feature Map Feature Map Transpose feature map a and perform matrix multiplication with feature map b to obtain the position attention map Perform matrix multiplication on the position attention map d and the feature map c and reshape it to obtain the feature map Output feature map of convolutional block V by channel attention module Do three reshapes to get the feature map Feature Map Feature Map Perform matrix multiplication on the transpose of feature map b′ and feature map a′ to obtain the channel attention map Perform matrix multiplication on the channel attention map d′ and the feature map c′ and reshape it to obtain the feature map The output of the self-attention module is the output feature map of convolution block V Feature Map and feature map of and;

[0019] The pooling layer II is an adaptive average pooling, the number of input and output channels is 512, and the output feature map size is 1×1;

[0020] The probability of dropout of the dropout layer is P, 0≤P≤1;

[0021] The shape of the input tensor of the fully connected layer is 512, and the shape of the output feature tensor is 5, that is, the number of carbon deposition degree categories.

[0022] Step 4: Divide the obtained preprocessed data set C into a training set D and a validation set E according to the ratio of X:Y;

[0023] Step 5: For each image A i The mean of all images in the training set D and the validation set E is calculated by adding each pixel, and the variance of all images in the training set D and the validation set E is calculated using the mean using the conventional variance calculation formula. The obtained mean and variance are normalized and set as the carbon deposition degree discrimination model Normalization parameters for training;

[0024] Step 6: Set up the carbon deposition degree discrimination model The optimizer, loss function, training round ε and batch size T for training; where:

[0025] The optimizer uses the SGD optimizer, the initial learning rate is 0.001, the learning rate is adjusted using the cosine decay strategy to decay to 0.0001, and the loss function uses the cross entropy loss function.

[0026] Step 7: Load the pre-trained weights of the Resnet18 network structure on the ImageNet general dataset, and retain the weights of the same part of the structure;

[0027] Step 8: Determine the carbon deposition model Perform iterative training and save the training weight W with the highest discrimination accuracy on the validation set E z, 0≤z≤ε;

[0028] Step 9: Use the trained weights W z Complete the carbon deposition degree determination model Actual measurement:

[0029] The specific operation is: collect the image A of the automobile engine part i ′, image C is obtained through step 2 i ′, using the carbon deposition degree discrimination model Load training weights W z Complete the test.

[0030] Compared with the prior art, the present invention has the following advantages:

[0031] The present invention proposes a method for determining the degree of carbon deposits in automobile engines based on endoscopic imaging. It uses a model based on deep learning to replace traditional manual determination, effectively improving the efficiency and accuracy of determining the degree of carbon deposits in automobile engines. Adaptive histogram equalization and bilateral filtering are used to solve problems such as low illumination, overexposure and chromatic noise in the image. Resnet18 is improved by adding adaptive pooling kernels, deformable convolutions and self-attention mechanism modules to improve the comprehensive performance of the carbon deposit degree determination model. Through testing of three engines, the recognition accuracy of this method was increased from 80% to 87.1%, indicating that the method has good compatibility and is conducive to promotion. BRIEF DESCRIPTION OF THE DRAWINGS

[0032] Figure 1 It is a schematic diagram of the network structure;

[0033] Figure 2 Schematic diagram of the self-attention mechanism module. DETAILED DESCRIPTION

[0034] In order to facilitate the understanding of the present invention, the present invention will be described more fully below. However, the present invention can be implemented in many different forms and is not limited to the embodiments described herein. On the contrary, the purpose of providing these embodiments is to make the understanding of the disclosure of the present invention more thorough and comprehensive.

[0035] A method for determining the degree of carbon deposit in an automobile engine based on endoscopic imaging, the specific method is as follows:

[0036] Step 1: Use endoscope equipment to collect original images of five parts of the automobile engine: the fuel injector, intake duct, intake valve, cylinder wall, and piston top, and construct the original data set A. For each image A in the original data set A, i Carry out carbon deposition classification labeling in sequence;

[0037] The specific operation of constructing the original data set A is as follows: collect N images for each part of the same type of vehicle, N ≥ 2500, then the number of original data sets A is 5N; the marked carbon deposit levels are divided into five levels: slight, mild, moderate, severe, and serious.

[0038] Step 2: For each image A in the original dataset A i Adaptive histogram equalization and bilateral filtering are performed in sequence to obtain the preprocessed data set C; where:

[0039] The specific operation of adaptive histogram equalization is as follows: First, each image A in the original data set A i Divide into M of equal size i ≥ 4 sub-blocks, calculate the histogram h of each sub-block i,j (x)(i=1,...,5N;j=1,...,M), x represents the gray level, and its value range is [0,L i,j -1], L i,j ≤255 is the possible number of gray levels; then calculate the histogram h i,j Clipping threshold (x) Where n is the contrast limiting factor, n>0, with H i,j is the threshold clipping h i,j (x), evenly distribute the cut pixels to the histogram h i,j In each gray level of (x), each sub-block is repeatedly allocated, and the reallocated histogram h i,j (x) Perform histogram equalization, and the equalization result is f i.j (x); finally, according to the equilibrium result f i.j (x) Get the gray value of the central pixel of each sub-block and use bilinear interpolation to calculate the gray value of image A. i The grayscale values ​​of each point in the image are reconstructed to obtain the equalized image B. i ;

[0040] The specific operation of bilateral filtering is: for the equalized image B i , through the formula The processed image C is obtained by calculation i , where B i (p,q) represents the input point, C i (u,v) is the output point, S(u,v) is the range of (2R+1)(2R+1) centered at (u,v), R is the radius of the filter kernel, and w(u,v,p,q) is the spatial Gaussian function w s and the scaled Gaussian function w r The calculated value, that is, w = w s ·w r , where σs is the spatial domain standard deviation, σ r is the standard deviation of the scale domain; all C i That is, a processed image set C is formed.

[0041] Step 3: Establish a carbon deposition degree discrimination model based on the Resnet18 network structure

[0042] Carbon deposition degree determination model It is composed of convolution block I, pooling layer I, convolution block II, convolution block III, convolution block IV, convolution block V, self-attention mechanism module, pooling layer II, dropout layer, and fully connected layer. Among them:

[0043] The convolution block I consists only of convolution layer Ia, the convolution kernel size of convolution layer Ia is 7×7, the step size is 2, the number of input channels is 3, the number of output channels is 64, and the output feature map size of convolution block I is 112×112;

[0044] The pooling layer I is an adaptive exponential pooling, which is calculated by the formula and Calculate the smooth approximate average value of the pooling core area P respectively and smooth approximate maximum where α k , α l is a single kernel vector, is the mean value of the pooling kernel area, l, k are pixel indices in the pooling kernel area; trainable weight mask β is then used to combine and Get the adaptive exponential pooling value of the pooling core area P The pooling kernel size is 3, the stride is 2, the number of input and output channels is 64, and the output feature map size is 56×56;

[0045] The convolution block II is formed by stacking and connecting convolution layer IIa, convolution layer IIb, convolution layer IIc, and convolution layer IId, wherein the convolution kernel size in convolution layer IIa, convolution layer IIb, convolution layer IIc, and convolution layer IId is 3×3, the step size is 1, the number of input and output channels is 64, and the output feature map size of convolution block II is 56×56;

[0046] The convolution block III includes convolution layer IIIa, convolution layer IIIb, convolution layer IIIc, convolution layer IIId, and convolution layer IIIe, wherein convolution layer IIIa, convolution layer IIIb, convolution layer IIId, and convolution layer IIIe are stacked and connected, and the convolution kernel size is 3×3. Convolution layer IIIc is a shortcut connection, connecting the input of convolution layer IIIa and the output of convolution layer IIIa, and the convolution kernel size is 1×1; the stride of convolution layer IIIa and convolution layer IIIc is 2, the number of input channels is 64, and the number of output channels is 128. The stride of convolution layer IIIb, convolution layer IIId, and convolution layer IIIe is 1, and the number of input and output channels is 128; the output feature map size of convolution block III is 28×28;

[0047] The convolution block IV comprises convolution layer IVa, convolution layer IVb, convolution layer IVc, convolution layer IVd, and convolution layer IVe, wherein convolution layer IVa, convolution layer IVb, convolution layer IVd, and convolution layer IVe are stacked and connected, and the convolution kernel size is 3×3; convolution layer IVc is a shortcut connection, connecting the input of convolution layer IVa and the output of convolution layer IVb, and the convolution kernel size is 1×1; the step size of convolution layer IVa and convolution layer IVc is 2, the number of input channels is 128, and the number of output channels is 256; the step size of convolution layer IVb, convolution layer IVd, and convolution layer IVe is 1, and the number of input and output channels is 256; the output feature map size of convolution block IV is 14×14;

[0048] The convolution block Va comprises convolution layers Va, Va, Va, Va, Va, Vad and Va, wherein the convolution layers Va, Va, Vad and Va are stacked and connected, and the convolution kernel size is 3×3; the convolution layer Va is a shortcut connection, and the convolution kernel size is 1×1, which connects the input of the convolution layer Va and the output of the convolution layer Va; the convolution layers Va and Va are connected in a stacked manner, and the convolution kernel size is 3×3; the convolution layer Va is a shortcut connection, and the convolution kernel size is 1×1, which connects the input of the convolution layer Va and the output of the convolution layer Va; the convolution layers Va and Va are connected in a stacked manner, and the convolution kernel size is 3×3; the convolution layer Va is connected in a stacked manner, and the convolution kernel size is 1×1; the convolution layer Va and the convolution layer Va are ... The stride of layer Ⅴc is 2, the number of input channels is 256, and the number of output channels is 512; the stride of convolution layer Ⅴd is 1, and the number of input and output channels is 512; convolution layer Ⅴb and convolution layer Ⅴe are deformable convolutions, which contain a padding layer and three convolution layers. The offset position and offset amplitude of the convolution kernel are adjusted through parallel convolution operations to obtain the offset domain and modulation scalar; the output feature map of convolution block V Size is 7×7;

[0049] The self-attention mechanism module includes a position attention module and a channel attention module; wherein the position attention module converts the output feature map of the convolution block V into The feature maps are generated through three conventional convolutional layers, and then reshaped to obtain the feature maps respectively. Feature Map Feature Map Transpose feature map a and perform matrix multiplication with feature map b to obtain the position attention map Perform matrix multiplication on the position attention map d and the feature map c and reshape it to obtain the feature map Output feature map of convolutional block V by channel attention module Do three reshapes to get the feature map Feature Map Feature Map Perform matrix multiplication on the transpose of feature map b′ and feature map a′ to obtain the channel attention map Perform matrix multiplication on the channel attention map d′ and the feature map c′ and reshape it to obtain the feature map The output of the self-attention module is the output feature map of convolution block V Feature Map and feature map of and;

[0050] The pooling layer II is an adaptive average pooling, the number of input and output channels is 512, and the output feature map size is 1×1;

[0051] The probability of dropout of the dropout layer is P (0≤P≤1);

[0052] The shape of the input tensor of the fully connected layer is 512, and the shape of the output feature tensor is 5, that is, the number of carbon deposition degree categories.

[0053] Step 4: Divide the obtained preprocessed data set C into a training set D and a validation set E according to the ratio of X:Y;

[0054] Step 5: For each image A i The mean of all images in the training set D and the validation set E is calculated by adding each pixel, and the variance of all images in the training set D and the validation set E is calculated using the mean using the conventional variance calculation formula. The obtained mean and variance are normalized and set as the carbon deposition degree discrimination model Normalization parameters for training;

[0055] Step 6: Set up the carbon deposition degree discrimination model The optimizer, loss function, training round ε and batch size T for training; where:

[0056] The optimizer uses the SGD optimizer, the initial learning rate is 0.001, the learning rate is adjusted using the cosine decay strategy to decay to 0.0001, and the loss function uses the cross entropy loss function.

[0057] Step 7: Load the pre-trained weights of the Resnet18 network structure on the ImageNet general dataset, and retain the weights of the same part of the structure;

[0058] Step 8: Determine the carbon deposition model Perform iterative training and save the training weight W with the highest discrimination accuracy on the validation set Ez (0≤z≤ε);

[0059] Step 9: Use the trained weights W z Complete the carbon deposition degree determination model Actual measurement:

[0060] The specific operation is: collect the image A of the automobile engine part i ′,A i ′ is the input image during the measurement process, and image C is obtained through step 2 i ′,C i ′ is the image obtained by processing in step 2 during the actual measurement process; the carbon deposition degree discrimination model is used Load training weights W z Complete the test.

[0061] Table 1 Comparison of experimental results of the present invention

[0062]

[0063] The method of the present invention combines image processing and model improvement, ResNet18 is the original model and unprocessed images are used as data sets. The method of the present invention far exceeds the original model in multiple image classification evaluation indicators, proving that the method of the present invention can effectively solve the problem of poor image quality during image acquisition, and the corresponding model discrimination scheme has a high accuracy rate. The method can be well applied to the identification of carbon deposits in different parts of the engine, and has a good market prospect.

[0064] The contents not described in detail in the specification of the present invention belong to the prior art known to the professional and technical personnel in the field. Although the illustrative specific embodiments of the present invention are described above to facilitate the understanding of the present invention by the technical personnel in the field, it should be clear that the present invention is not limited to the scope of the specific embodiments. For the ordinary technical personnel in the field, as long as various changes are within the spirit and scope of the present invention defined and determined by the attached claims, these changes are obvious, and all inventions and creations using the concept of the present invention are protected.

Claims

1. A method for determining the degree of carbon deposit in an automobile engine based on endoscopic imaging, characterized in that: The following steps are involved: Step 1: Use endoscope equipment to collect original images of five parts of the automobile engine: the fuel injector, intake duct, intake valve, cylinder wall, and piston top, and construct the original data set A. For each image A in the original data set A, i Carry out carbon deposition classification labeling in sequence; Step 2: For each image A in the original dataset A i Adaptive histogram equalization and bilateral filtering are performed in sequence to obtain the preprocessed data set C; Step 3: Establish a carbon deposition degree discrimination model based on the Resnet18 network structure Step 4: Divide the obtained preprocessed data set C into a training set D and a validation set E according to the ratio of X:Y; Step 5: For each image A i The mean of all images in the training set D and the validation set E is calculated by adding each pixel, and the variance of all images in the training set D and the validation set E is calculated using the mean using the conventional variance calculation formula. The obtained mean and variance are normalized and set as the carbon deposition degree discrimination model Normalization parameters for training; Step 6: Set up the carbon deposit degree discrimination model The optimizer, loss function, training round ε and batch size T for training; Step 7: Load the pre-trained weights of the Resnet18 network structure on the ImageNet general dataset, and retain the weights of the same part of the structure; Step 8: Determine the carbon deposition degree model Perform iterative training and save the training weight W with the highest discrimination accuracy on the validation set E z , 0≤z≤ε; Step 9: Use the trained weights W z Complete the carbon deposition degree determination model The actual measurement.

2. The method for determining the degree of carbon deposit in an automobile engine based on endoscopic imaging according to claim 1 is characterized in that: The specific operation of constructing the original data set A in step 1 is: collect N images for each part of the same type of vehicle, N≥2500, then the number of original data sets A is 5N; the marked carbon deposit degree categories are divided into five levels: slight, mild, moderate, severe, and serious.

3. The method for determining the degree of carbon deposit in an automobile engine based on endoscopic imaging according to claim 2 is characterized in that: Step 2: For each image A in the original data set A i Adaptive histogram equalization and bilateral filtering are performed in sequence to obtain the preprocessed data set C; where: The specific operation of adaptive histogram equalization is: first, each image A in the original data set A i Divide into M of equal size i ≥ 4 sub-blocks, calculate the histogram h of each sub-block i,j (x)(i=1,...,5N;j=1,...,M), x represents the gray level, and its value range is [0,L i,j -1], L i,j ≤255 is the possible number of gray levels; then calculate the histogram h i,j Clipping threshold of (x) Where n is the contrast limiting factor, n>0, with H i,j is the threshold clipping h i,j (x), evenly distribute the cut pixels to the histogram h i,j In each gray level of (x), each sub-block is repeatedly allocated, and the reallocated histogram h i,j (x) Perform histogram equalization, and the equalization result is f i.j (x); finally, according to the equilibrium result f i.j (x) Get the gray value of the central pixel of each sub-block and use bilinear interpolation to calculate the gray value of image A. i The grayscale values ​​of each point in the image are reconstructed to obtain the equalized image B. i ; The specific operation of bilateral filtering is: for the equalized image B i , through the formula The processed image C is obtained by calculation i , where B i (p,q) represents the input point, C i (u,v) is the output point, S(u,v) is the range of (2R+1)(2R+1) centered at (u,v), R is the radius of the filter kernel, and w(u,v,p,q) is the spatial Gaussian function w s and the scaled Gaussian function w r The calculated value, that is, w = w s ·w r , where σ s is the spatial domain standard deviation, σ r is the standard deviation of the scale domain; all C i That is, a processed image set C is formed.

4. The method for determining the degree of carbon deposit in an automobile engine based on endoscopic imaging according to claim 3 is characterized in that: The carbon deposition degree discrimination model established based on the Resnet18 network structure in step 3 It is composed of convolution block I, pooling layer I, convolution block II, convolution block III, convolution block IV, convolution block V, self-attention mechanism module, pooling layer II, dropout layer, and fully connected layer. Among them: The convolution block I consists only of convolution layer Ia, the convolution kernel size of convolution layer Ia is 7×7, the step size is 2, the number of input channels is 3, the number of output channels is 64, and the output feature map size of convolution block I is 112×112; The pooling layer I is an adaptive exponential pooling, which is calculated by the formula and Calculate the smooth approximate average value of the pooling core area P respectively and smooth approximate maximum where α k , α l is a single kernel vector, is the mean value of the pooling kernel area, l, k are pixel indices in the pooling kernel area; trainable weight mask β is then used to combine and Get the adaptive exponential pooling value of the pooling core area P The pooling kernel size is 3, the stride is 2, the number of input and output channels is 64, and the output feature map size is 56×56; The convolution block II is formed by stacking and connecting convolution layer IIa, convolution layer IIb, convolution layer IIc, and convolution layer IId, wherein the convolution kernel size in convolution layer IIa, convolution layer IIb, convolution layer IIc, and convolution layer IId is 3×3, the step size is 1, the number of input and output channels is 64, and the output feature map size of convolution block II is 56×56; The convolution block III includes convolution layer IIIa, convolution layer IIIb, convolution layer IIIc, convolution layer IIId, and convolution layer IIIe, wherein convolution layer IIIa, convolution layer IIIb, convolution layer IIId, and convolution layer IIIe are stacked and connected, and the convolution kernel size is 3×3. Convolution layer IIIc is a shortcut connection, connecting the input of convolution layer IIIa and the output of convolution layer IIIa, and the convolution kernel size is 1×1; the stride of convolution layer IIIa and convolution layer IIIc is 2, the number of input channels is 64, and the number of output channels is 128. The stride of convolution layer IIIb, convolution layer IIId, and convolution layer IIIe is 1, and the number of input and output channels is 128; the output feature map size of convolution block III is 28×28; The convolution block IV comprises convolution layer IVa, convolution layer IVb, convolution layer IVc, convolution layer IVd, and convolution layer IVe, wherein convolution layer IVa, convolution layer IVb, convolution layer IVd, and convolution layer IVe are stacked and connected, and the convolution kernel size is 3×3; convolution layer IVc is a shortcut connection, connecting the input of convolution layer IVa and the output of convolution layer IVb, and the convolution kernel size is 1×1; the step size of convolution layer IVa and convolution layer IVc is 2, the number of input channels is 128, and the number of output channels is 256; the step size of convolution layer IVb, convolution layer IVd, and convolution layer IVe is 1, and the number of input and output channels is 256; the output feature map size of convolution block IV is 14×14; The convolution block Va comprises convolutional layers Va, Va, Va, Va, Vad and Va, wherein the convolutional layers Va, Va, Vad and Va are stacked and connected, and the convolutional kernel size is 3×3; the convolutional layer Va is a shortcut connection, and the convolutional kernel size is 1×1, connecting the input of the convolutional layer Va and the output of the convolutional layer Va; the convolutional layers Va and Va are connected in a stacked manner, and the convolutional kernel size is 3×3; the convolutional layer Va is a shortcut connection, and the convolutional kernel size is 1×1, connecting the input of the convolutional layer Va and the output of the convolutional layer Va; the convolutional layers Va and Va are connected in a stacked manner, and the convolutional kernel size is 3×3; the convolutional layer Va is connected in a stacked manner, and the convolutional kernel size is 1×1; the convolutional layer Va and the convolutional layer Va are ... The stride of layer Ⅴc is 2, the number of input channels is 256, and the number of output channels is 512; the stride of convolution layer Ⅴd is 1, and the number of input and output channels is 512; convolution layer Ⅴb and convolution layer Ⅴe are deformable convolutions, which contain a padding layer and three convolution layers. The offset position and offset amplitude of the convolution kernel are adjusted through parallel convolution operations to obtain the offset domain and modulation scalar; the output feature map of convolution block V Size is 7×7; The self-attention mechanism module includes a position attention module and a channel attention module; wherein the position attention module converts the output feature map of the convolution block V into The feature maps are generated through three conventional convolutional layers, and then reshaped to obtain the feature maps respectively. Feature Map Feature Map Transpose feature map a and perform matrix multiplication with feature map b to obtain the position attention map Perform matrix multiplication on the position attention map d and the feature map c and reshape it to obtain the feature map Output feature map of convolutional block V by channel attention module Do three reshapes to get the feature map Feature Map Feature Map Perform matrix multiplication on the transpose of feature map b′ and feature map a′ to obtain the channel attention map Perform matrix multiplication on the channel attention map d′ and the feature map c′ and reshape it to obtain the feature map The output of the self-attention module is the output feature map of convolution block V Feature Map and feature map of and; The pooling layer II is an adaptive average pooling, the number of input and output channels is 512, and the output feature map size is 1×1; The probability of dropout of the dropout layer is P, 0≤P≤1; The shape of the input tensor of the fully connected layer is 512, and the shape of the output feature tensor is 5, that is, the number of carbon deposition degree categories.

5. The method for determining the degree of carbon deposit in an automobile engine based on endoscopic imaging according to claim 4 is characterized in that: The optimizer in step 6 adopts the SGD optimizer, the initial learning rate is 0.001, the learning rate is adjusted to decay to 0.0001 using the cosine decay strategy, and the loss function adopts the cross entropy loss function.

6. The method for determining the degree of carbon deposit in an automobile engine based on endoscopic imaging according to claim 5 is characterized in that: The training weight W is used in step 9 z Complete the carbon deposition degree judgment model The specific operation of the actual measurement is: collect the image of the automobile engine part, process the image through step 2, and use the carbon deposition degree discrimination model Load training weights W z Complete the test.

Citation Information

Patent Citations

  • Upgrading method of target detection network model based on deformable convolution

    CN111814884A

  • Data enhancement method based on big law algorithm and channel attention mechanism

    CN116912144A

  • Lane detection method integratedly using image enhancement and deep convolutional neural network

    US20230186439A1

Cited By

  • Portable engine carbon deposition degree distinguishing equipment and use method

    CN121074339A

  • A Multimodal AI-Based Engine Carbon Deposit Quantification Detection and Early Warning System

    CN123071710A