An endoscopic imaging-based method for determining the degree of carbon deposition in a vehicle engine
Patent Information
- Application Number
- CN202410604271.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-15
- Publication Date
- 2026-10-27
- Estimated Expiration
- 2044-05-15
AI Technical Summary
[0003]针对内窥镜随机姿态的干扰会导致图像出现低照度、过曝和色度噪声等问题,智能判断目前还没有一个识别率高、兼容性好的算法,本发明提供了一种基于内窥成像的汽车发动机积碳程度判别方法
[0031]本发明提出的一种基于内窥成像的汽车发动机积碳程度判别方法,使用基于深度学习的模型判别替代传统的人工判别,有效提高汽车发动机积碳程度判别的效率和准确率。采用自适应直方图均衡化和双边滤波的处理方式解决图像中存在低照度、过曝和色度噪声等问题。通过添加自适应池化核、可变形卷积和自注意力机制模块改进Resnet18,提高积碳程度判别模型的综合性能。通过对3种发动机的测试,该方法的识别准确率从80%提升到87.1%,表明该方法兼容性较好,有利于推广。
Smart Images

Figure CN118537636B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of automotive testing technology, specifically relating to a method for determining the degree of carbon buildup in automotive engines based on endoscopic imaging. Background Technology
[0002] Impurities in automotive fuel, when incompletely combusted under high temperature and pressure, produce a gel-like substance that accumulates on the surfaces of various engine parts, forming carbon deposits. Long-term carbon buildup can lead to problems such as unstable idling and increased fuel consumption, thus affecting vehicle performance. Effective carbon deposit cleaning methods can mitigate the impact of carbon deposits on vehicle performance and extend the vehicle's lifespan. Currently, cleaning is mainly based on the experience of inspectors and the driver's subjective preference, which can lead to over-cleaning or under-cleaning, increasing cleaning costs. Therefore, it is necessary to accurately assess the severity of carbon deposits in the engine to provide reasonable cleaning recommendations and feedback on the cleaning results. Shenzhen Jieyi Testing Service Co., Ltd. (CN202110661929.9) proposes inserting an endoscope into the engine to collect images, followed by visual observation or intelligent judgment, providing an intuitive visual basis for determining the degree of carbon deposits. However, this manual judgment method is prone to misjudgment and is inefficient, hindering its widespread application. Hu Binyu (DOI: 10.27470 / d.cnki.ghbgc.2020.000380) used GPU parallelism to accelerate model training, but did not conduct specific research on improving recognition accuracy. Tang Yuanzhi et al. (CN112819783B) used a panoramic image acquisition device to acquire real-time panoramic images of the engine interior and compared them with pre-stored images of a carbon-free background to determine the degree of carbon buildup. This method is effective for detecting surfaces with high flatness, but it is not suitable for detecting multiple parts inside the engine. Due to the interference of the random posture of the endoscope, the images suffer from problems such as low illumination, overexposure, and chromatic noise. Currently, there is no algorithm with high recognition rate and good compatibility for intelligent judgment. Summary of the Invention
[0003] To address the issues of low illumination, overexposure, and chromatic noise in images caused by the random posture of the endoscope, there is currently no algorithm with high recognition rate and good compatibility for intelligent judgment. This invention provides a method for judging the degree of carbon deposits in automobile engines based on endoscopic imaging.
[0004] To achieve the above objectives, the present invention employs the following technical solutions:
[0005] Step 1: Use an endoscope to acquire raw images of five parts of the car engine: fuel injectors, intake manifold, intake valves, cylinder walls, and piston tops. Construct an original dataset A. For each image A in the original dataset A... i The degree of carbon buildup is then labeled sequentially.
[0006] The specific steps to construct the original dataset A are as follows: collect N images for each part of the same type of vehicle, where N≥2500, so the number of original datasets A is 5N; the labeled carbon deposition levels are divided into 5 levels: slight, mild, moderate, severe, and critical.
[0007] Step 2: For each image A in the original dataset A i Adaptive histogram equalization and bilateral filtering are performed sequentially to obtain the preprocessed dataset C; where:
[0008] The specific operation of adaptive histogram equalization is as follows: First, each image A in the original dataset A... i Divide into M of the same size i For ≥4 sub-blocks, calculate the histogram h for each sub-block. i,j (x)(i=1,...,5N;j=1,...,M), where x represents the gray level, and its value range is [0,L]. i,j -1], L i,j ≤255 represents the possible grayscale levels; then calculate the histogram h. i,j Shear threshold of (x) Where n is the contrast limiting factor, n>0, with H i,j Threshold shearing h i,j (x) distributes the cut pixels evenly across histogram h. i,j In each gray level of (x), each sub-block is repeatedly assigned, and the histogram h after the reassignment is processed. i,j (x) is subjected to histogram equalization, and the equalization result is f. i.j (x); finally, based on the equilibrium result f i.j (x) Obtain the grayscale value of the center pixel of each sub-block, and use bilinear interpolation to process image A. i The gray values of each point in the image are reconstructed to obtain the equalized image B. i ;
[0009] The specific operation of bilateral filtering is as follows: For the equalization image B i Through formula The calculation yields the processed image C. i B i (p,q) represents the input point, C i (u,v) is the output point, S i (u,v) represents the range of size (2R+1)(2R+1) centered at (u,v), where R is the radius of the filter kernel, and w(u,v,p,q) is a spatial Gaussian function. s and scale Gaussian function w r The calculated value, i.e., w = w s ·wr , Where σ s It is the standard deviation of the space domain, σ r For the scale-domain standard deviation; all C i This results in the formation of a processed image set C.
[0010] Step 3: Establish a carbon deposition level discrimination model based on the ResNet18 network structure
[0011] Carbon deposition level discrimination model It consists of stacked convolutional block I, pooling layer I, convolutional block II, convolutional block III, convolutional block IV, convolutional block V, self-attention mechanism module, pooling layer II, dropout layer, and fully connected layer; wherein:
[0012] The convolutional block I consists of only convolutional layer Ia, with a kernel size of 7×7, a stride of 2, 3 input channels, and 64 output channels. The output feature map size of convolutional block I is 112×112.
[0013] Pooling layer I is an adaptive exponential pooling layer, defined by the formula... and Calculate the smooth approximate average value of the pooling kernel region P respectively. and smooth approximate maximum value Where α k α l For a single kernel vector, This represents the average value of the pooling kernel region. l and k are pixel indices in the pooling kernel region; then, a trainable weight mask β is used for combination. and Obtain the adaptive exponential pooling value of the pooling kernel region 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 convolutional block II is formed by stacking convolutional layers IIa, IIb, IIc, and IId. The convolutional kernels in convolutional layers IIa, IIb, IIc, and IId are all 3×3 in size, with a stride of 1 and 64 input and output channels. The output feature map of convolutional block II is 56×56 in size.
[0015] The convolutional block III comprises convolutional layers IIIa, IIIb, IIIc, IIId, and IIIe. Convolutional layers IIIa, IIIb, IIId, and IIIe are stacked and connected, each with a 3×3 kernel. Convolutional layer IIIc is a shortcut connection, connecting the input and output of convolutional layer IIIa, with a 1×1 kernel. The stride of convolutional layers IIIa and IIIc is 2, with 64 input channels and 128 output channels. The stride of convolutional layers IIIb, IIId, and IIIe is 1, with 128 input and output channels each. The output feature map size of convolutional block III is 28×28.
[0016] The convolutional block IV comprises convolutional layers IVa, IVb, IVc, IVd, and IVe. Convolutional layers IVa, IVb, IVd, and IVe are stacked and connected, each with a 3×3 kernel size. Convolutional layer IVc is a shortcut connection, connecting the input of convolutional layer IVa to the output of convolutional layer IVb, with a 1×1 kernel size. The stride of convolutional layers IVa and IVc is 2, with 128 input channels and 256 output channels. The stride of convolutional layers IVb, IVd, and IVe is 1, with 256 input and output channels each. The output feature map size of convolutional block IV is 14×14.
[0017] The convolutional block V comprises convolutional layers VA, Vb, Vc, Vd, and Ve, wherein convolutional layers VA, Vb, Vd, and Ve are stacked and connected, each with a 3×3 kernel size; convolutional layer Vc is a shortcut connection with a 1×1 kernel size, connecting the input of convolutional layer VA and the output of convolutional layer VAb; convolutional layers VA and Ve are connected in a stacked manner. Layer Vc has a stride of 2, 256 input channels, and 512 output channels; convolutional layer Vd has a stride of 1 and 512 input and output channels; convolutional layers Vb and Ve are deformable convolutions, containing one padding layer and three convolutional layers. They obtain the offset domain and modulation scalar by adjusting the offset position and magnitude of the convolutional kernels through parallel convolutional operations; the output feature map of convolutional block V... The size is 7×7;
[0018] The self-attention mechanism module includes a positional attention module and a channel attention module; wherein the positional attention module receives the output feature map of convolutional block V. Feature maps are generated through three conventional convolutional layers, and then reshaped to obtain feature maps. Feature map Feature map Transpose feature map a and perform matrix multiplication with feature map b to obtain the positional attention map. Perform matrix multiplication and shape reshaping on the positional attention map d and feature map c to obtain the feature map. The channel attention module outputs feature maps of convolutional block V. The feature map is obtained by performing three shape reshaping operations. 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 and shape reshaping on the channel attention map d′ and feature map c′ to obtain the feature map. Output of the self-attention mechanism module Output feature map of convolutional block V Feature map and feature map The sum of;
[0019] The pooling layer II is an adaptive average pooling layer with 512 input and output channels and a 1×1 output feature map size.
[0020] The probability of the dropout layer dropping out is P, 0≤P≤1;
[0021] The fully connected layer has an input tensor with a shape of 512 and an output feature tensor with a shape of 5, which represents the number of carbon deposition degree categories.
[0022] Step 4: Divide the obtained preprocessed dataset C into training set D and validation set E according to the X:Y ratio;
[0023] Step 5: Extract each image A i The mean of all images in the training set D and validation set E is calculated by summing the values of each pixel. Then, the variance of all images in the training set D and validation set E is calculated using the standard variance calculation formula based on the mean. The obtained mean and variance are then normalized and used as the model for judging carbon accumulation levels. Normalized parameters for training;
[0024] Step 6: Set up the carbon deposition level discrimination model The optimizer, loss function, number of training epochs ε, and batch size T are used for training; where:
[0025] The optimizer used is the SGD optimizer, with an initial learning rate of 0.001. The learning rate is adjusted using a cosine decay strategy to decrease to 0.0001, and the loss function is the cross-entropy loss function.
[0026] Step 7: Load the pre-trained weights of the ResNet18 network structure on the ImageNet general dataset, retaining the weights of the same parts of the structure;
[0027] Step 8: Determination model for carbon deposition level Perform iterative training and save the training weights W that achieve the highest accuracy on the validation set E. z, 0≤z≤ε;
[0028] Step 9: Use training weights W z Complete the carbon deposition discrimination model Actual measurements:
[0029] The specific operation is as follows: Acquire image A of the car engine area. i Image C is obtained through step 2. i Using a carbon deposition degree discrimination model Load training weights W z Test complete.
[0030] Compared with the prior art, the present invention has the following advantages:
[0031] This invention proposes a method for identifying the degree of carbon buildup in automotive engines based on endoscopic imaging. It replaces traditional manual identification with a deep learning-based model, effectively improving the efficiency and accuracy of carbon buildup identification. Adaptive histogram equalization and bilateral filtering are employed to address issues such as low illumination, overexposure, and chromatic noise in the images. The ResNet18 algorithm is improved by adding adaptive pooling kernels, deformable convolutions, and self-attention mechanisms, enhancing the overall performance of the carbon buildup identification model. Testing on three types of engines shows that the method's recognition accuracy increased from 80% to 87.1%, indicating good compatibility and potential for widespread adoption. Attached Figure Description
[0032] Figure 1 This is a schematic diagram of the network structure;
[0033] Figure 2 This is a schematic diagram of the self-attention mechanism module. Detailed Implementation
[0034] To facilitate understanding of the present invention, a more comprehensive description will be given below. However, the present invention can be implemented in many different forms and is not limited to the embodiments described herein. Rather, these embodiments are provided to provide a thorough and complete understanding of the disclosure of the present invention.
[0035] A method for determining the degree of carbon buildup in automotive engines based on endoscopic imaging, the specific method is as follows:
[0036] Step 1: Use an endoscope to acquire raw images of five parts of the car engine: fuel injectors, intake manifold, intake valves, cylinder walls, and piston tops. Construct an original dataset A. For each image A in the original dataset A... i The degree of carbon buildup is then labeled sequentially.
[0037] The specific steps to construct the original dataset A are as follows: collect N images for each part of the same type of vehicle, where N≥2500, so the number of original datasets A is 5N; the labeled carbon deposition levels are divided into 5 levels: slight, mild, moderate, severe, and critical.
[0038] Step 2: For each image A in the original dataset A i Adaptive histogram equalization and bilateral filtering are performed sequentially to obtain the preprocessed dataset C; where:
[0039] The specific operation of adaptive histogram equalization is as follows: First, each image A in the original dataset A... i Divide into M of the same size i For ≥4 sub-blocks, calculate the histogram h for each sub-block. i,j (x)(i=1,...,5N;j=1,...,M), where x represents the gray level, and its value range is [0,L]. i,j -1], L i,j ≤255 represents the possible grayscale levels; then calculate the histogram h. i,j Shear threshold of (x) Where n is the contrast limiting factor, n>0, with H i,j Threshold shearing h i,j (x) distributes the cut pixels evenly across histogram h. i,j In each gray level of (x), each sub-block is repeatedly assigned, and the histogram h after the reassignment is processed. i,j (x) is subjected to histogram equalization, and the equalization result is f. i.j (x); finally, based on the equilibrium result f i.j (x) Obtain the grayscale value of the center pixel of each sub-block, and use bilinear interpolation to process image A. i The gray values of each point in the image are reconstructed to obtain the equalized image B. i ;
[0040] The specific operation of bilateral filtering is as follows: For the equalization image B i Through formula The calculation yields the processed image C. i B i (p,q) represents the input point, C i (u,v) is the output point, S(u,v) is the range of size (2R+1) centered at (u,v), R is the radius of the filter kernel, and w(u,v,p,q) is a function of the spatial Gaussian function w s and scale Gaussian function w r The calculated value, i.e., w = w s ·w r , Where σs It is the standard deviation of the space domain, σ r For the scale-domain standard deviation; all C i This results in the formation of a processed image set C.
[0041] Step 3: Establish a carbon deposition level discrimination model based on the ResNet18 network structure
[0042] Carbon deposition level discrimination model It consists of stacked convolutional block I, pooling layer I, convolutional block II, convolutional block III, convolutional block IV, convolutional block V, self-attention mechanism module, pooling layer II, dropout layer, and fully connected layer; wherein:
[0043] The convolutional block I consists of only convolutional layer Ia, with a kernel size of 7×7, a stride of 2, 3 input channels, and 64 output channels. The output feature map size of convolutional block I is 112×112.
[0044] Pooling layer I is an adaptive exponential pooling layer, defined by the formula... and Calculate the smooth approximate average value of the pooling kernel region P respectively. and smooth approximate maximum value Where α k α l For a single kernel vector, This represents the average value of the pooling kernel region. l and k are pixel indices in the pooling kernel region; then, a trainable weight mask β is used for combination. and Obtain the adaptive exponential pooling value of the pooling kernel region 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 convolutional block II is formed by stacking convolutional layers IIa, IIb, IIc, and IId. The convolutional kernels in convolutional layers IIa, IIb, IIc, and IId are all 3×3 in size, with a stride of 1 and 64 input and output channels. The output feature map of convolutional block II is 56×56 in size.
[0046] The convolutional block III comprises convolutional layers IIIa, IIIb, IIIc, IIId, and IIIe. Convolutional layers IIIa, IIIb, IIId, and IIIe are stacked and connected, each with a 3×3 kernel. Convolutional layer IIIc is a shortcut connection, connecting the input and output of convolutional layer IIIa, with a 1×1 kernel. The stride of convolutional layers IIIa and IIIc is 2, with 64 input channels and 128 output channels. The stride of convolutional layers IIIb, IIId, and IIIe is 1, with 128 input and output channels each. The output feature map size of convolutional block III is 28×28.
[0047] The convolutional block IV comprises convolutional layers IVa, IVb, IVc, IVd, and IVe. Convolutional layers IVa, IVb, IVd, and IVe are stacked and connected, each with a 3×3 kernel size. Convolutional layer IVc is a shortcut connection, connecting the input of convolutional layer IVa to the output of convolutional layer IVb, with a 1×1 kernel size. The stride of convolutional layers IVa and IVc is 2, with 128 input channels and 256 output channels. The stride of convolutional layers IVb, IVd, and IVe is 1, with 256 input and output channels each. The output feature map size of convolutional block IV is 14×14.
[0048] The convolutional block V comprises convolutional layers VA, Vb, Vc, Vd, and Ve, wherein convolutional layers VA, Vb, Vd, and Ve are stacked and connected, each with a 3×3 kernel size; convolutional layer Vc is a shortcut connection with a 1×1 kernel size, connecting the input of convolutional layer VA and the output of convolutional layer VAb; convolutional layers VA and Ve are connected in a stacked manner. Layer Vc has a stride of 2, 256 input channels, and 512 output channels; convolutional layer Vd has a stride of 1 and 512 input and output channels; convolutional layers Vb and Ve are deformable convolutions, containing one padding layer and three convolutional layers. They obtain the offset domain and modulation scalar by adjusting the offset position and magnitude of the convolutional kernels through parallel convolutional operations; the output feature map of convolutional block V... The size is 7×7;
[0049] The self-attention mechanism module includes a positional attention module and a channel attention module; wherein the positional attention module receives the output feature map of convolutional block V. Feature maps are generated through three conventional convolutional layers, and then reshaped to obtain feature maps. Feature map Feature map Transpose feature map a and perform matrix multiplication with feature map b to obtain the positional attention map. Perform matrix multiplication and shape reshaping on the positional attention map d and feature map c to obtain the feature map. The channel attention module outputs feature maps of convolutional block V. The feature map is obtained by performing three shape reshaping operations. 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 and shape reshaping on the channel attention map d′ and feature map c′ to obtain the feature map. Output of the self-attention mechanism module Output feature map of convolutional block V Feature map and feature map The sum of;
[0050] The pooling layer II is an adaptive average pooling layer with 512 input and output channels and a 1×1 output feature map size.
[0051] The probability of the dropout layer dropping out is P (0≤P≤1);
[0052] The fully connected layer has an input tensor with a shape of 512 and an output feature tensor with a shape of 5, which represents the number of carbon deposition degree categories.
[0053] Step 4: Divide the obtained preprocessed dataset C into training set D and validation set E according to the X:Y ratio;
[0054] Step 5: Extract each image A i The mean of all images in the training set D and validation set E is calculated by summing the values of each pixel. Then, the variance of all images in the training set D and validation set E is calculated using the standard variance calculation formula based on the mean. The obtained mean and variance are then normalized and used as the model for judging carbon accumulation levels. Normalized parameters for training;
[0055] Step 6: Set up the carbon deposition level discrimination model The optimizer, loss function, number of training epochs ε, and batch size T are used for training; where:
[0056] The optimizer used is the SGD optimizer, with an initial learning rate of 0.001. The learning rate is adjusted using a cosine decay strategy to decrease to 0.0001, and the loss function is the cross-entropy loss function.
[0057] Step 7: Load the pre-trained weights of the ResNet18 network structure on the ImageNet general dataset, retaining the weights of the same parts of the structure;
[0058] Step 8: Determination model for carbon deposition level Perform iterative training and save the training weights W that achieve the highest accuracy on the validation set E.z (0≤z≤ε);
[0059] Step 9: Use training weights W z Complete the carbon deposition discrimination model Actual measurements:
[0060] The specific operation is as follows: Acquire image A of the car engine area. i ′, A i Image C is the image input during the actual measurement process, which is processed in step 2 to obtain image C. i ′, C i The image shown is the result of step 2 processing during the actual measurement; a carbon deposition level discrimination model is used. Load training weights W z Test complete.
[0061] Table 1 Comparison of experimental results of the present invention
[0062]
[0063] This invention combines image processing and model improvement, using ResNet18 as the original model and unprocessed images as the dataset. The proposed method significantly outperforms the original model in multiple image classification evaluation metrics, demonstrating its effectiveness in addressing the issue of low image quality during image acquisition. Furthermore, the corresponding model discrimination scheme exhibits high accuracy. This method is well-suited for identifying the degree of carbon buildup in different parts of an engine and possesses promising market prospects.
[0064] Contents not described in detail in this specification are prior art known to those skilled in the art. Although illustrative specific embodiments of the invention have been described above to facilitate understanding by those skilled in the art, it should be understood that the invention is not limited to the scope of the specific embodiments. Various modifications are readily apparent to those skilled in the art as long as they fall within the spirit and scope of the invention as defined and determined by the appended claims, and all inventions utilizing the concept of this invention are protected.
Claims
1. A method for determining the degree of carbon buildup in automotive engines based on endoscopic imaging, characterized in that, Includes the following steps: Step 1: Use an endoscope to acquire raw images of five parts of the car engine: fuel injectors, intake manifold, intake valves, cylinder walls, and piston tops. Construct an original dataset A. For each image A in the original dataset A... i The degree of carbon buildup is then labeled sequentially. Step 2: For each image A in the original dataset A i Adaptive histogram equalization and bilateral filtering are performed sequentially to obtain the preprocessed dataset C; Step 3: Establish a carbon deposition level discrimination model based on the ResNet18 network structure ; The carbon deposition level discrimination model established in step 3 based on the ResNet18 network structure It is composed of convolutional block I, pooling layer I, convolutional block II, convolutional block III, convolutional block IV, convolutional block V, self-attention mechanism module, pooling layer II, dropout layer, and fully connected layer stacked together; The pooling layer I is an adaptive exponential pooling layer; The convolutional block V comprises convolutional layers VA, Vb, Vc, Vd, and Ve, wherein convolutional layers VA, Vb, Vd, and Ve are stacked and connected, each with a 3×3 kernel size; convolutional layer Vc is a shortcut connection with a 1×1 kernel size, connecting the input of convolutional layer VA and the output of convolutional layer VAb; convolutional layers VA and Ve are connected in a stacked manner. Layer Vc has a stride of 2, 256 input channels, and 512 output channels; convolutional layer Vd has a stride of 1 and 512 input and output channels; convolutional layers Vb and Ve are deformable convolutions, containing one padding layer and three convolutional layers. They obtain the offset domain and modulation scalar by adjusting the offset position and magnitude of the convolutional kernels through parallel convolutional operations; the output feature map of convolutional block V... The size is 7×7; The self-attention mechanism module includes a positional attention module and a channel attention module; the output of the self-attention mechanism module... Output feature map of convolutional block V Feature maps output by the position attention module Feature maps output by the channel attention module The sum of; The pooling layer II is an adaptive average pooling layer; Step 4: Divide the obtained preprocessed dataset C into training set D and validation set E according to the X:Y ratio; Step 5: Extract each image A i The mean of all images in the training set D and validation set E is calculated by summing the values of each pixel. Then, the variance of all images in the training set D and validation set E is calculated using the standard variance calculation formula based on the mean. The obtained mean and variance are then normalized and used as the model for judging carbon accumulation levels. Normalized parameters for training; Step 6: Set up the carbon deposition level discrimination model Optimizer, loss function, and training epochs during training and batch size T; Step 7: Load the pre-trained weights of the ResNet18 network structure on the ImageNet general dataset, retaining the weights of the same parts of the structure; Step 8: Determination model for carbon deposition level Perform iterative training and save the training weights that achieve the highest accuracy on the validation set E. , ; Step 9: Use training weights Complete the carbon deposition level discrimination model Actual measurements.
2. The method for determining the degree of carbon buildup in an automotive engine based on endoscopic imaging according to claim 1, characterized in that, The specific operation for constructing the original dataset A in step 1 is as follows: collect N images for each part of the same type of vehicle, N≥2500, then the number of original datasets A is 5N; the labeled carbon deposition level is divided into 5 levels: slight, mild, moderate, severe, and serious.
3. The method for determining the degree of carbon buildup in an automotive engine based on endoscopic imaging according to claim 2, characterized in that, Step 2: For each image A in the original dataset A... i Adaptive histogram equalization and bilateral filtering are performed sequentially to obtain the preprocessed dataset C; where: The specific operation of adaptive histogram equalization is as follows: First, each image A in the original dataset A... i Divided into equal sizes For each sub-block, calculate its histogram. ,in, , Represents grayscale level, with a value range of 100%. , The possible gray levels are then calculated; the histogram is then calculated. shear threshold Where n is the contrast limiting factor, n > 0, and so on. Threshold shearing The cut pixels are evenly distributed across the histogram. In each gray level, each sub-block is repeatedly assigned, and the histogram after reassignment is analyzed. Perform histogram equalization, the equalization result is: Finally, based on the equilibrium results The grayscale values of the center pixels of each sub-block are obtained, and bilinear interpolation is used to process image A. i The gray values of each point in the image are reconstructed to obtain the equalized image B. i ; The specific operation of bilateral filtering is as follows: For the equalization image B i Through formula The calculation yields the processed image C. i ,in Represents the input point, C i (u,v) is the output point, and S(u,v) is centered at (u,v). The range of the size, where R is the radius of the filter kernel. It is a spatial Gaussian function and scale Gaussian function w r The calculated value, i.e. , , ,in It is the standard deviation in the space domain. For the scale-domain standard deviation; all C i This results in the formation of a processed image set C.
4. The method for determining the degree of carbon buildup in an automotive engine based on endoscopic imaging according to claim 3, characterized in that, In step 3, the kernel size of convolutional layer Ia is 7×7, the stride is 2, the number of input channels is 3, the number of output channels is 64, and the output feature map size of convolutional block I is 112×112. Pooling layer I is an adaptive exponential pooling layer, defined by the formula... and Calculate the smooth approximate average value of the pooling kernel region P respectively. and smooth approximate maximum value ,in , For a single kernel vector, This represents the average value of the pooling kernel region. l and k are pixel indices in the pooling kernel region; then a trainable weight mask is used. combination and Obtain the adaptive exponential pooling value of the pooling kernel region 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 convolutional block II is formed by stacking convolutional layers IIa, IIb, IIc, and IId. The convolutional kernels in convolutional layers IIa, IIb, IIc, and IId are all 3×3 in size, have a stride of 1, and have 64 input and output channels. The output feature map of convolutional block II is 56×56 in size. The convolutional block III comprises convolutional layers IIIa, IIIb, IIIc, IIId, and IIIe. Convolutional layers IIIa, IIIb, IIId, and IIIe are stacked and connected, each with a 3×3 kernel. Convolutional layer IIIc is a shortcut connection, connecting the input and output of convolutional layer IIIa, with a 1×1 kernel. The stride of convolutional layers IIIa and IIIc is 2, with 64 input channels and 128 output channels. The stride of convolutional layers IIIb, IIId, and IIIe is 1, with 128 input and output channels each. The output feature map size of convolutional block III is 28×28. The convolutional block IV comprises convolutional layers IVa, IVb, IVc, IVd, and IVe. Convolutional layers IVa, IVb, IVd, and IVe are stacked and connected, each with a 3×3 kernel size. Convolutional layer IVc is a shortcut connection, connecting the input of convolutional layer IVa to the output of convolutional layer IVb, with a 1×1 kernel size. The stride of convolutional layers IVa and IVc is 2, with 128 input channels and 256 output channels. The stride of convolutional layers IVb, IVd, and IVe is 1, with 256 input and output channels each. The output feature map size of convolutional block IV is 14×14. The self-attention mechanism module includes a positional attention module and a channel attention module; wherein the positional attention module receives the output feature map of convolutional block V. Feature maps are generated through three conventional convolutional layers, and then reshaped to obtain feature maps. Feature map Feature map For feature maps Then perform transpose and feature map Executing matrix multiplication to obtain positional attention diagram Pay attention to the location diagram. and feature map Perform matrix multiplication and shape reshaping to obtain the feature map. The channel attention module outputs the feature map of convolutional block V. The feature map is obtained by performing three shape reshaping operations. Feature map Feature map For feature maps With feature map Transpose of matrix multiplication to obtain channel attention diagram Pay attention to the channel diagram. and feature map Perform matrix multiplication and shape reshaping to obtain the feature map. Output of the self-attention mechanism module Output feature map of convolutional block V Feature map and feature map The sum of; The pooling layer II is an adaptive average pooling layer with 512 input and output channels and a 1×1 output feature map size. The probability of the dropout layer dropping out is P, where 0 ≤ P ≤ 1; The fully connected layer has an input tensor with a shape of 512 and an output feature tensor with a shape of 5, which represents the number of carbon deposition degree categories.
5. The method for determining the degree of carbon buildup in an automotive engine based on endoscopic imaging according to claim 4, characterized in that, The optimizer used in step 6 is the SGD optimizer, with an initial learning rate of 0.
001. The learning rate is adjusted using a cosine decay strategy to decrease to 0.0001, and the loss function is the cross-entropy loss function.
6. The method for determining the degree of carbon buildup in an automotive engine based on endoscopic imaging according to claim 5, characterized in that, The training weights are used in step 9. Complete the carbon deposition level discrimination model The specific operation of the actual test is as follows: acquire images of the car engine area, process the images in step 2, and use the carbon deposit degree discrimination model. Load training weights Test complete.
Citation Information
Patent Citations
A method and device for identifying in-cylinder carbon deposits in engines based on image background difference.
CN112819783B
Engine detection method, system, computer device and storage medium
CN113284131B