Classified detection method for uniformity of cement paste

Through the combination of multi-scale adaptive enhancement and deep convolutional neural network, the subjectivity and inefficiency of traditional cement slurry uniformity detection are solved, efficient and accurate cement slurry uniformity classification is achieved, and the quality control capability of construction projects is improved.

CN120451682AActive Publication Date: 2025-08-08SHANDONG LUQIAO GROUP CO LTD
View PDF 13 Cites 0 Cited by

Patent Information

Application Number
CN202510886856.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-30
Publication Date
2025-08-08
Estimated Expiration
2045-06-30

AI Technical Summary

Technical Problem

Traditional cement slurry uniformity detection methods rely on manual visual inspection, with subjective differences and inefficiency problems. It is difficult for the existing technology to effectively retain key information in the image and take into account multi-scale structural characteristics, resulting in inaccuracy and inefficiency of detection.

Method used

Using multi-scale adaptive enhancement function, deep convolutional neural network and collaborative attention mechanism, cement slurry images are taken through industrial cameras, preprocessed and manually annotated, and adaptive convolutional layer, dual-branch module, cascaded hollow pyramid module and collaborative attention module are constructed, and the loss function is calculated in combination with weighted cross entropy to achieve cement slurry uniformity classification.

Benefits of technology

It improves the accuracy and reliability of cement slurry uniformity testing, reduces the influence of subjective factors, improves inspection efficiency and reduces costs, and provides support for construction project quality control.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120451682A_ABST
    Figure CN120451682A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of artificial intelligence and data processing, in particular to a cement paste uniformity classification detection method, which specifically comprises the following steps: shooting a cement paste image; preprocessing the cement paste image, and performing manual annotation to form a training data set; constructing a multi-scale adaptive enhancement function to enhance the cement paste image in the training data set; constructing a cement paste uniformity classification model based on a deep convolutional neural network, inputting the enhanced cement paste image into the model for cement paste uniformity classification prediction, and then calculating a training loss function of the model based on weighted cross entropy; iterative training is carried out on the constructed model, iteration is stopped until preset conditions are met, and a trained model is obtained; and inputting the new cement paste image into the trained model for cement paste uniformity classification prediction to obtain a final uniformity classification result. According to the invention, high-precision and automatic classification of the uniformity of the cement paste can be realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of artificial intelligence and data processing technology, and in particular to a cement slurry uniformity classification detection method. Background Art

[0002] Cement slurry plays a crucial role in the construction materials industry. As an essential and key component, its uniformity has a profound impact on the strength and performance of building structures. During construction, uniform cement slurry ensures structural stability and durability, providing a solid foundation for building safety. Conversely, uneven cement slurry can create weak points in the building structure, increasing safety risks.

[0003] Traditional methods for assessing cement slurry uniformity rely primarily on manual visual inspection or simple physical measurements. Manual visual inspection requires inspectors to rely on their experience and subjective judgment to assess cement slurry uniformity. However, differences in visual acuity, experience, and subjective standards among inspectors make test results susceptible to subjective interference, leading to a lack of consistency and accuracy. Furthermore, manual inspection requires significant time and effort, making this method extremely inefficient for large-scale construction projects and difficult to meet the demands of real-world projects.

[0004] While simple physical measurement methods can provide some information about cement slurry uniformity, due to limitations in their measurement principles and methods, they can only obtain limited indicators and cannot fully and accurately reflect the true uniformity of the cement slurry. These traditional methods are cumbersome and require extensive measurement and record-keeping, increasing the difficulty and cost of testing.

[0005] The existing technology has the following objective shortcomings: the conventional brightness enhancement method used in the existing technology destroys the high-frequency texture structure and cannot effectively retain key information such as particle boundaries and bubble contours; the traditional convolution kernel size used in the existing technology is fixed, which makes it difficult to take into account the structural features of cement slurry images from micron to centimeter scales; the existing technology lacks a parallel modeling mechanism for macrostructure and micro details, resulting in a single feature expression dimension and insufficient discrimination ability; the existing technology predicts that the output confidence is too high, and the loss function fails to give sufficient weight to uneven areas, affecting the learning effect of key areas.

[0006] Therefore, the present invention proposes a cement slurry uniformity classification detection method to solve the above problems. Summary of the Invention

[0007] In view of the shortcomings of the existing technology, the present invention develops a cement slurry uniformity classification detection method. By proposing an automated cement slurry uniformity classification detection method, the present invention can improve the accuracy and reliability of detection, reduce the influence of subjective factors, and greatly improve detection efficiency and reduce detection costs.

[0008] The technical solution to the technical problem of the present invention is a method for classifying and detecting cement slurry uniformity, comprising the following steps: S1. Use an industrial camera to photograph a standard cement slurry sample prepared in the laboratory or at the construction site under standard lighting conditions. The captured image must cover the typical interface or surface of the cement slurry to obtain a cement slurry image. S2. Preprocess the collected cement slurry images to remove some noise from the images and unify the data format. Professionals then manually annotate the images according to the preset uniformity level completion standards to form the training dataset. S3, constructing a multi-scale adaptive enhancement function to enhance the cement slurry images in the training dataset; S4. A cement slurry uniformity classification model is constructed based on a deep convolutional neural network. The core structure of the model includes an adaptive convolution layer, a dual-branch module, a cascaded void pyramid module, a collaborative attention module, and an output layer. The enhanced cement slurry image is input into the model for cement slurry uniformity classification prediction. The training loss function of the model is then calculated based on weighted cross entropy. S5. Iteratively train the constructed model until the preset conditions are met and the iteration is stopped to obtain a trained model; S6. Input the new cement slurry image into the trained model to perform cement slurry uniformity classification prediction and obtain the final uniformity classification result.

[0009] S2 is as follows: S2.1. Preprocessing: First, the collected cement slurry images are uniformly converted into grayscale images or their RGB three-channel information is retained. Then, image size normalization is performed to adjust all cement slurry images to a preset fixed size. The cement slurry images are initially smoothed using a filtering method such as Gaussian filtering or median filtering, ultimately obtaining preprocessed cement slurry images. S2.2. Manual labeling: The pre-processed cement slurry images are manually labeled based on visual features, including the density and uniformity of particle distribution in the cement slurry images, the number and size distribution of bubbles, and whether there is obvious agglomeration or segregation. The pre-processed cement slurry images are judged and labeled with preset category labels, including highly uniform, generally uniform, slightly uneven, and severely uneven; ultimately, a training dataset is formed.

[0010] S3 is as follows: A multi-scale adaptive enhancement function is constructed. The cement slurry image in the input training dataset is converted to the frequency domain through Fourier transform. A high-frequency enhancement term with Laplacian characteristics is constructed based on the frequency domain Gaussian filter function to highlight the edge information of the corresponding frequency position in the cement slurry image. Then, the high-frequency enhancement term is multiplied point by point with the Fourier transform result of the cement slurry image to strengthen the specific components in the frequency domain. The image is then restored to the spatial domain through inverse Fourier transform. At the same time, the directional gradient of the cement slurry image is calculated in the spatial domain. The gradient direction angle is determined based on the local standard deviation to retain the directional information of the macrostructure. The frequency domain enhancement term and the spatial domain gradient are applied to the cement slurry image through element-by-element multiplication to generate the enhanced cement slurry image. The calculation formula is as follows: , in, is the input cement slurry image; is the enhanced cement slurry image; is element-wise multiplication; is the Fourier transform; is the inverse Fourier transform; is a frequency domain Gaussian filter, is the frequency coordinate vector; The input cement slurry image The directional gradient operator, is the gradient direction angle; is the fusion coefficient.

[0011] The operations in the adaptive convolution layer are as follows: Enhanced cement slurry image Perform convolution operation. The size of the convolution kernel is not fixed. According to the enhanced cement slurry image The complexity of the local area is dynamically adjusted, and the enhanced cement slurry image For each central pixel position in the image, the local information entropy of the fixed-size neighborhood window centered on it is calculated. Based on the local information entropy value, a linear mapping is performed between the preset minimum kernel size and the maximum kernel size to obtain the kernel expansion coefficient, and the kernel expansion coefficient is used to control the size of the Gaussian kernel function range. An adaptive convolution operation is performed on the enhanced image at the central pixel position to obtain an adaptive convolution feature map. ; The calculation formula in the adaptive convolution layer is as follows: , in, Represents the adaptive convolution operation; is the set of neighborhood pixels covered by the convolution kernel; is the neighborhood pixel position index, is the center pixel position index; The enhanced cement slurry image is shown in The pixel value of the pixel position; is the Gaussian kernel function; For the The kernel dilation coefficient at the pixel position; Represents the norm symbol.

[0012] The operations in the dual-branch module are as follows: First, the adaptive convolution feature map is processed and fused in two paths to obtain the dual-branch fused feature map; 1) Macro branch: The macro branch will adaptively convolute the feature map Input multiple dilated convolutional layers with different dilation rates to extract global features and obtain a global feature map. ; 2) Micro branches: Microscopic branches for adaptive convolutional feature maps Perform discrete wavelet transform to obtain the feature tensor after discrete wavelet transform ,right Decomposition yields a low-frequency component feature map and three high-frequency component feature maps. The low-frequency component feature map is expressed as , the high-frequency component feature map includes the horizontal high-frequency component feature map , vertical high-frequency component feature map And the diagonal high-frequency component feature map ; Then, the high frequency component feature map After the residual block is refined, it is combined with the global feature map Fusion, get the feature map after dual-branch fusion , the calculation formula is as follows: , in, It is the feature map after dual-branch fusion; is the Sigmoid activation function; is the convolution weight matrix of macro features; represents each high-frequency component in the wavelet decomposition, Corresponding to the high-frequency component in the horizontal direction, Corresponding to the high-frequency component in the vertical direction, Corresponding to the high-frequency components in the diagonal direction; is the high-frequency component feature map; For the fusion impact factor, set ; is the convolution weight matrix of high-frequency component features.

[0013] The operations in the cascaded hole pyramid module are as follows: The feature map after the two branches are fused Input cascade hollow pyramid module for processing, cascade hollow pyramid module The internal information flow path is bidirectional, and the bidirectional information flow path is parallel computing; Cascaded Hollow Pyramid Module In the above example, each void rate is processed independently and defined as is the void ratio, and , indicating that the void ratios are 1, 3, and 5 respectively; for each void ratio , the cascaded hollow pyramid module uses the same input features, that is, the input features of the cascaded hollow pyramid module are the feature maps after dual-branch fusion , the feature map after dual-branch fusion Feature maps after dilated convolution obtained by dilated convolution with different dilation rates ; Then, the feature map after the dilated convolution After cascading the hollow pyramid module The internal bidirectional information flow path is the upsampling path and the downsampling path, and the feature map after the hole convolution The upsampling path feature map is obtained by going through the upsampling path and the downsampling path respectively. and downsampling path feature map , then and Perform weighted fusion to obtain a bidirectional fusion path feature map ; Finally, the bidirectional fusion path feature map Corresponding void ratio Aggregate all feature maps of the cascaded hole pyramid module to obtain the feature map output by the cascaded hole pyramid module .

[0014] 7. The method for classifying and detecting cement slurry uniformity according to claim 6, wherein the operations in the collaborative attention module are as follows: The feature map output by the cascaded hole pyramid module Apply the attention mechanism to obtain the feature map output by the collaborative attention module The attention mechanism applied includes global average pooling operation, multi-layer perceptron and Sigmoid activation function from The channel attention map extracted from , and the maximum pooling feature from the channel dimension after 7×7 convolution operation and Sigmoid activation function and channel dimension mean pooling features The spatial attention map extracted from ;Will With channel attention map and spatial attention map Feature fusion is performed by element-by-element multiplication to obtain the feature map output by the collaborative attention module , the calculation formula is as follows: , in, This is element-wise multiplication.

[0015] The operations in the output layer are as follows: Feature map output by the collaborative attention module Processing is performed to obtain the classification prediction probability. First, the feature map Convert it into a one-dimensional vector and input it into the preset fully connected layer to get the original output value of each category ; Then, calculate the feature map The variance in the channel dimension, and based on this variance and a preset scaling factor , calculate the sample related temperature coefficient , the calculation formula is as follows: , in, Representation feature map Variance in the channel dimension; is the scaling factor; Finally, in the standard Softmax function calculation, the sample-related temperature coefficient is used The original output value for each category Scaling is performed to obtain the probability value of the sample prediction for each category. The calculation formula is as follows: , in, The probability value of the sample predicted as the cth category; is the total number of categories; For the The original output value of each category.

[0016] The training loss function based on the weighted cross entropy calculation model is as follows: Based on the training loss function of the weighted cross entropy calculation model, for each input cement slurry image, its gradient vector and entropy value are calculated. Then, the weight factor of the image is calculated by combining the maximum value of the gradient norm, the preset gradient norm weight coefficient and the local entropy weight coefficient. Finally, when calculating the cross entropy loss of all images, the weight factor of each image is used to weight its loss term to obtain the final loss value. , the calculation formula is as follows: , in, is the number of input cement slurry images; is the label of the i-th image belonging to the c-th actual category, specifically 0 or 1, indicating whether it belongs to the category or not; Predict the probability value of the cth category for the i-th image; For the The weight factor for each image.

[0017] S5 is as follows: The cement slurry image dataset that has undergone image acquisition, preprocessing, annotation, and enhancement preprocessing is used as training samples and their corresponding annotation labels. The training process adopts a small batch gradient descent strategy. In each iteration, a small batch of samples is randomly selected from the dataset and input into the model for forward propagation calculation to obtain the prediction results. Then, the error and loss function value between the current batch prediction result and the true label are calculated, and the error backpropagation operation is performed using the backpropagation algorithm to calculate the gradient of the learnable parameters in the model relative to the loss function. The learnable parameters in the model include the convolution kernel weight and bias term; Finally, the stochastic gradient descent method is used to update and adjust all parameters of the model according to the preset learning rate to minimize the loss function and gradually improve the predictive ability of the model. The above process is iterated repeatedly until the preset stop iteration condition is met to obtain a trained model. The stop iteration condition is: 1) Set a maximum training round limit. When the actual training round reaches this preset maximum, training will be forced to stop regardless of the model performance; 2) Monitor the performance of the model on an independent validation set. During training, regularly use a validation set that was not used in training to evaluate the model's classification performance, calculate the model's classification accuracy, or observe the loss value. When the model's performance indicators on the validation set no longer improve or even begin to decline over multiple consecutive rounds, it is determined that the model performance has reached saturation or shows signs of overfitting. At this time, even if the maximum round limit has not been reached, stop training early.

[0018] The effects provided in the summary of the invention are only the effects of the embodiments, rather than all the effects of the invention. The above technical solution has the following advantages or beneficial effects: The present invention enhances the image by constructing a multi-scale adaptive enhancement function, specifically integrating frequency domain high-frequency enhancement and spatial gradient guidance, avoiding weakening the texture details of the image, and can significantly improve the ability to distinguish between microscopic boundaries and macroscopic structural features; the present invention adopts an adaptive convolution layer that dynamically adjusts the convolution kernel scale based on local information entropy, which can avoid the problem that it is difficult to take into account these multi-scale structures at the same time, resulting in the model receptive field being unable to cover key texture details, affecting the discriminability of convolution features, and thus improving the adaptability of the model to particle aggregation structures of different scales; the present invention constructs a dual-branch network that integrates void convolution and wavelet decomposition, and extracts multi-scale context through cascaded void pyramid modules, avoiding the problem that feature expression is biased towards a single scale and cannot simultaneously capture the correlation between details and the whole, thereby enhancing the discriminability of features and improving classification accuracy; the present invention adopts a collaborative attention mechanism and a temperature scaling strategy based on feature variance, which can avoid the problem that it is difficult to simultaneously coordinate constraints on spatial position and channel response, resulting in unfocused attention response and increased background information interference, thereby improving the model's responsiveness to sparse abnormal areas and the prediction stability of fuzzy samples.

[0019] In summary, the present invention can not only improve the accuracy and reliability of detection and reduce the influence of subjective factors, but also greatly improve detection efficiency and reduce detection costs, providing strong support for the quality control of construction projects. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] The accompanying drawings are used to provide further understanding of the present invention and constitute a part of the specification. They are used to explain the present invention together with the embodiments of the present invention and do not constitute a limitation of the present invention.

[0021] Figure 1 Schematic diagram of the method of the present invention.

[0022] Figure 2 A line graph showing the impact of the fusion coefficient on classification performance.

[0023] Figure 3 This is a comparison chart of image enhancement effects.

[0024] Figure 4 is the feature map of local information entropy.

[0025] Figure 5 Comparison chart of confidence distribution of fuzzy sample predictions.

[0026] Figure 6 The figure is a comparison chart of the classification accuracy of the method of the present invention and the existing method. DETAILED DESCRIPTION

[0027] To clearly illustrate the technical features of this solution, the present invention is described in detail below through specific embodiments and in conjunction with the accompanying drawings. The following disclosure provides many different embodiments or examples for implementing different structures of the present invention. To simplify the disclosure of the present invention, the components and configurations of specific examples are described below.

[0028] Example 1 A method for classifying and detecting cement slurry uniformity comprises the following steps: S1. Use an industrial camera to photograph a standard cement slurry sample prepared in the laboratory or at the construction site under standard lighting conditions. The captured image must cover the typical interface or surface of the cement slurry to obtain a cement slurry image. When photographing and collecting samples, the samples must be left still for a specified time to reflect their actual state and avoid external disturbances. The lighting must be uniform and stable to avoid shadows and reflections. S2. Preprocess the collected cement slurry images to remove some noise from the images and unify the data format. Professionals then manually annotate the images according to the preset uniformity level completion standards to form the training dataset. S3, constructing a multi-scale adaptive enhancement function to enhance the cement slurry images in the training dataset; S4. A cement slurry uniformity classification model is constructed based on a deep convolutional neural network. The core structure of the model includes an adaptive convolution layer, a dual-branch module, a cascaded void pyramid module, a collaborative attention module, and an output layer. The enhanced cement slurry image is input into the model for cement slurry uniformity classification prediction. The training loss function of the model is then calculated based on weighted cross entropy. S5. Iteratively train the constructed model until the preset conditions are met and the iteration is stopped to obtain a trained model; S6. Input the new cement slurry image into the trained model to perform cement slurry uniformity classification prediction and obtain the final uniformity classification result.

[0029] The unknown cement slurry sample to be classified is photographed, and then the photographed cement slurry image is preprocessed and enhanced to ensure that the input format is consistent with the training data. It is then input into the cement slurry uniformity classification model built based on the deep convolutional neural network. The model output layer calculates the predicted probability value of the input image belonging to each preset uniformity category, and selects the category with the highest probability as the final uniformity classification result of the cement slurry image.

[0030] In a specific implementation manner, S2 is specifically as follows: S2.1. Preprocessing: First, the collected cement slurry images are uniformly converted into grayscale images or their RGB three-channel information is retained. Then, image size normalization is performed to adjust all cement slurry images to a preset fixed size. A filtering method is used to perform preliminary smoothing on the cement slurry images. The filtering method includes Gaussian filtering or median filtering, which can suppress random noise and slight sensor noise that may be introduced during the image acquisition process, and finally the preprocessed cement slurry images are obtained. S2.2. Manual labeling: To conduct supervised training of the cement slurry uniformity classification model, the pre-processed cement slurry images are labeled. The labeling work is completed by professional and experienced personnel according to the preset uniformity grade standard. Specifically, the pre-processed cement slurry images are manually labeled based on visual features. The visual features include the density and uniformity of particle distribution in the cement slurry image, the number and size distribution of bubbles, and whether there is obvious agglomeration or segregation. The pre-processed cement slurry images are judged and labeled with preset category labels, including highly uniform, generally uniform, slightly uneven, and severely uneven; finally, a training dataset is formed.

[0031] In a specific implementation, S3 is as follows: In the actual acquisition process, cement slurry images are often accompanied by local structures such as microscopic bubbles, particle agglomeration, and uneven bonding, showing significant scale difference characteristics. On the macro scale, the uneven area often manifests as continuous changes in brightness, while on the micro scale, it manifests as high-frequency texture features such as blurred boundaries and local mutations. Conventional preprocessing methods, such as histogram equalization and global contrast stretching, often focus on improving the balance of overall brightness distribution, but will weaken the texture details of the original image during the operation, especially the continuity of high-frequency components, which will lead to the loss of key texture features such as microscopic particle boundaries and bubble contours. Therefore, the present invention constructs a multi-scale adaptive enhancement function. The Fourier transform converts the cement slurry image in the input training data set into the frequency domain, and constructs a high-frequency enhancement term with Laplacian characteristics based on the frequency domain Gaussian filter function to highlight the edge information of the corresponding frequency position in the cement slurry image. Then, the high-frequency enhancement term is multiplied point by point with the Fourier transform result of the cement slurry image to strengthen the specific components in the frequency domain. Then, it is restored to the spatial domain through the inverse Fourier transform. At the same time, the directional gradient of the cement slurry image is calculated in the spatial domain, and the gradient direction angle is determined based on the local standard deviation to retain the directional information of the macrostructure. The frequency domain enhancement term and the spatial domain gradient are applied to the cement slurry image through element-by-element multiplication to generate the enhanced cement slurry image. The calculation formula is as follows: , in, The input cement slurry image represents the original RGB three-channel cement slurry image data; is the enhanced cement slurry image; is element-wise multiplication; is the Fourier transform, Converting spatial domain images into frequency domain can facilitate the analysis of global and local textures that are difficult to capture in the spatial domain. is the inverse Fourier transform, which restores the modified frequency domain image to the spatial domain; is a frequency domain Gaussian filter, is the frequency coordinate vector; The input cement slurry image The directional gradient operator, is the gradient direction angle; is the fusion coefficient, such as Figure 2 As shown, by analyzing the impact of the fusion coefficient on the classification performance, the setting The classification performance is the best when , the classification performance includes accuracy and F1 score, Figure 2 It can be seen that the bilinear graph shows that when the fusion coefficient changes from 0.2 to 0.9, the response curves of the classification accuracy and F1 score both reach a peak at 0.7.

[0032] The frequency domain Gaussian filter can enhance high-frequency details without destroying low-frequency structures based on the fuzzy characteristics of microscopic bubbles and particle boundaries in cement slurry. The calculation formula is as follows: , in, is an exponential function with a natural constant as its base; is the frequency coordinate vector, which is a two-dimensional frequency coordinate vector derived from the frequency domain coordinates obtained after Fourier transform of the image, expressed as ; is the frequency coordinate vector Axis component, ; is the frequency coordinate vector Axis component, ; is the height of the cement slurry image, that is, the number of pixel matrix rows of the cement slurry image; is the width of the cement slurry image, that is, the number of pixel matrix columns of the cement slurry image; is the frequency domain index, is the horizontal coordinate of the frequency domain index, is the vertical coordinate of the frequency domain index; is the center of the frequency domain, and the input cement slurry image size is taken as Department; is the parameter that controls the bandwidth. , is the minimum value function; is the L2 norm; The calculation of the directional gradient operator can retain the directional information of the macroscopic segregation or flow trace of the cement slurry and avoid the geometric distortion caused by frequency domain enhancement. The calculation formula is as follows: , in, represents the horizontal coordinate of the image space coordinate, is the ordinate of the image space coordinate; is the gradient direction angle. Segregation in cement paste often manifests as directional texture. The gradient direction angle is used to capture the macrostructure, which is obtained by dynamic calculation of the local standard deviation. , for The local standard deviation in the axial direction, for local standard deviation in the axial direction; It should be noted that each pixel value of the cement slurry image represents the brightness or color information of a certain position in the spatial domain. Through Fourier transform, each spatial position in the image will be converted into a frequency component, which can more clearly understand the texture, edge and other features in the image; The term represents the Laplace operator, and the further calculation method is expressed as The Laplace operator is a rotationally symmetric operator that responds uniformly to edges in all directions and is suitable for processing cement paste images with non-directional characteristics of micro-texture. The value of the term is small in the low-frequency region, which can retain the macroscopic features, and is large in the high-frequency region to enhance the microscopic edges, thereby suppressing the low-frequency background and highlighting the high-frequency textures at the microscopic scale such as bubble contours and particle boundaries, while maintaining the continuity of the frequency domain energy distribution.

[0033] like Figure 3 As shown in Figure 3, it is a comparison between the original image and the enhanced image. Compared with the original image, the enhanced image more highlights the high-frequency textures at the microscopic scale, such as bubble outlines and particle boundaries.

[0034] In a specific implementation, the operations in the adaptive convolution layer are as follows: The inhomogeneous structure in cement slurry images is unevenly distributed in spatial scales, and its particle cluster structure may appear from micron to centimeter scales. Conventional convolution operations use fixed-scale convolution kernels, which are difficult to take into account these multi-scale structures at the same time, resulting in the model receptive field being unable to cover key texture details, thereby affecting the discriminability of convolution features; Therefore, the present invention enhances the cement slurry image. Perform convolution operation. The size of the convolution kernel is not fixed. According to the enhanced cement slurry image The complexity of the local area is dynamically adjusted, and the enhanced cement slurry image For each central pixel position in the image, the local information entropy of the fixed-size neighborhood window centered on it is calculated. Based on the local information entropy value, a linear mapping is performed between the preset minimum kernel size and the maximum kernel size to obtain the kernel expansion coefficient, and the kernel expansion coefficient is used to control the size of the Gaussian kernel function range. An adaptive convolution operation is performed on the enhanced image at the central pixel position to obtain an adaptive convolution feature map. ; The calculation formula in the adaptive convolution layer is as follows: , in, Represents the adaptive convolution operation; is the set of neighborhood pixels covered by the convolution kernel; is the neighborhood pixel position index, is the center pixel position index; The enhanced cement slurry image is shown in The pixel value of the pixel position; is the Gaussian kernel function; For the The kernel dilation coefficient at the pixel position; Represents the norm symbol.

[0035] The above kernel expansion coefficient adaptively covers the multi-scale cluster structure of cement slurry, which can avoid the loss of details or over-smoothing caused by fixed convolution kernel. The calculation formula is as follows: , in, is the minimum kernel size, set ; is the maximum kernel size, set ; For the first The local information entropy of a 7×7 window centered on a pixel can measure the complexity of the local area; is the minimum value of local information entropy; is the maximum value of local information entropy; The calculation formula of local information entropy is as follows: , in, is the neighborhood pixel index; It is a logarithmic function, with base 10 by default; For the first A 7×7 neighborhood pixel set centered on a pixel point; For the The frequency of the grayscale values of the neighborhood pixels in the local neighborhood, and for all neighborhood pixels, satisfy ; like Figure 4 As shown, this is the feature map after marking the local information entropy. Figure 4 In the figure, the larger the local information entropy is, the richer the detail information in the area is and the more obvious the green mark is.

[0036] It should be noted that the kernel dilation coefficient realizes the adaptive feature refinement of convolution, so that areas with rich details such as particle edges or bubble areas in the image can use finer convolution kernels, while simpler areas use coarser convolution kernels to better capture multi-scale features and improve classification accuracy.

[0037] In a specific implementation, the operations in the dual-branch module are as follows: In cement slurry images, uniformity judgment depends not only on the spatial layout of the macrostructure but also on the microscopic details of the local area. Due to the limited receptive field, a single-path convolutional neural network cannot simultaneously model long-range dependencies and fine-grained features at the same level, which easily leads to feature expression biased towards a single scale, affecting the overall discrimination effect. Therefore, the present invention first performs dual-path processing and fusion on the adaptive convolution feature map to obtain a dual-branch fused feature map. 1) Macro branch: The macro branch will adaptively convolute the feature map Input multiple dilated convolutional layers with different dilation rates to extract global features and obtain a global feature map. ; Specifically, three layers of dilated convolution with dilation rates of 2, 4, and 6 are used to extract global features; 2) Micro branches: Microscopic branches for adaptive convolutional feature maps Perform discrete wavelet transform to obtain the feature tensor after discrete wavelet transform ,right Decomposition yields a low-frequency component feature map and three high-frequency component feature maps. The low-frequency component feature map is expressed as , the high-frequency component feature map includes the horizontal high-frequency component feature map , vertical high-frequency component feature map And the diagonal high-frequency component feature map ; The calculation formula of discrete wavelet transform is as follows: , in, is the discrete wavelet transform function, is the feature tensor after discrete wavelet transform, Can be decomposed into ; It should be noted that in order to be more sensitive to the edge features of the cement slurry, such as the bubble boundary and particle contour, the present invention uses Haar wavelet as the mother wavelet of discrete wavelet transform, which can ensure fast calculation and good edge response; Then, the high frequency component feature map After the residual block is refined, it is combined with the global feature map Fusion, get the feature map after dual-branch fusion , the calculation formula is as follows: , in, It is the feature map after dual-branch fusion; is the Sigmoid activation function; is the convolution weight matrix of macro features; represents each high-frequency component in the wavelet decomposition, Corresponding to the high-frequency component in the horizontal direction, Corresponding to the high-frequency component in the vertical direction, Corresponding to the high-frequency components in the diagonal direction; is the high-frequency component feature map; For the fusion impact factor, set ; is the convolution weight matrix of high-frequency component features.

[0038] for Item, you can also input its value into the preset BatchNorm normalization layer for normalization, and then use it with The items are added together to achieve scale unification of feature fusion.

[0039] In a specific implementation, the operations in the cascaded hole pyramid module are as follows: The inhomogeneous areas in cement slurry images have significant multi-scale expression characteristics. For example, small bubbles or crack structures may exist at different spatial scales. Traditional single-scale or hierarchical feature pyramid structures often cannot capture the relationship between details and the whole at the same time, resulting in insufficient expression of key information. Therefore, the present invention combines the feature map after dual-branch fusion into a multi-scale feature pyramid. Input cascade hollow pyramid module for processing, cascade hollow pyramid module The internal information flow path is bidirectional, and the bidirectional information flow path is parallel computing; Cascaded Hollow Pyramid Module In the above example, each void rate is processed independently and defined as is the void ratio, and , indicating that the void ratios are 1, 3, and 5 respectively; for each void ratio , the cascaded hollow pyramid module uses the same input features, that is, the input features of the cascaded hollow pyramid module are the feature maps after dual-branch fusion , the feature map after dual-branch fusion Feature maps after dilated convolution obtained by dilated convolution with different dilation rates , Represents the feature map after the dilated convolution with a dilated rate of 1. Represents the feature map after the dilated convolution with a dilated rate of 2. Represents the feature map after dilated convolution with a dilated rate of 3; Then, the feature map after the dilated convolution After cascading the hollow pyramid module The internal bidirectional information flow path is the upsampling path and the downsampling path, and the feature map after the hole convolution The upsampling path feature map is obtained by going through the upsampling path and the downsampling path respectively. and downsampling path feature map , then and Perform weighted fusion to obtain a bidirectional fusion path feature map ; The operations in the upsampling path are as follows: Feature map after dilated convolution go through Convolution enhances the multi-scale receptive field, and then amplifies the feature map size through bilinear upsampling to capture large-scale macro information. The calculation formula is as follows: , in, is the upsampling path feature map; is bilinear upsampling; for Convolution operation; The operations in the downsampling path are as follows: Feature map after dilated convolution Passing by Convolution, then through Max pooling reduces the size of the feature map and can focus on small-scale micro details. The calculation formula is as follows: , in, is the downsampling path feature map; It is 2×2 maximum pooling; The operation of bidirectional path feature fusion is as follows: Output the upsampling path and downsampling path output Perform weighted fusion, weighted sum is nonlinearly mapped through LeakyReLU activation function, and convolved with the feature map after the original input void Element-by-element addition can preserve the original information and enhance cross-scale interactions. The calculation formula is as follows: , in, It means element-by-element addition; is the bidirectional fusion path feature map; is the LeakyReLU activation function; Represents the convolution operation; is the convolution kernel weight of the upsampling path; is the convolution kernel weight of the downsampling path; Finally, the bidirectional fusion path feature map Corresponding void ratio Aggregate all feature maps of the cascaded hole pyramid module to obtain the feature map output by the cascaded hole pyramid module The aggregation method can be cascade or weighted summation. If the weighted summation method is used, the void rate is defined as The corresponding weighted weight is , then the aggregation method achieved by weighted summation is expressed as , Need to be preset manually, for example, the void rate The corresponding weighted weights are set to 0.7, 0.2, and 0.1, respectively, giving a larger weight to a smaller void ratio, highlighting the fine-grained extraction capability of microscopic and local features.

[0040] In a specific implementation, the operations in the collaborative attention module are as follows: Abnormal areas in cement slurry images usually have significant spatial sparsity. For example, bubble clusters only appear in certain locations of the image. Traditional attention mechanisms mostly perform feature screening based on a single dimension of channel or space, making it difficult to simultaneously coordinate spatial position and channel response, resulting in unfocused attention response and increased background information interference. Therefore, the present invention uses the feature map output by the cascaded void pyramid module to generate a new feature map. Apply the attention mechanism to obtain the feature map output by the collaborative attention module The attention mechanism applied includes global average pooling operation, multi-layer perceptron and Sigmoid activation function from The channel attention map extracted from , and the maximum pooling feature from the channel dimension after 7×7 convolution operation and Sigmoid activation function and channel dimension mean pooling features The spatial attention map extracted from ;Will With channel attention map and spatial attention map Feature fusion is performed by element-by-element multiplication to obtain the feature map output by the collaborative attention module , the calculation formula is as follows: , in, This is element-wise multiplication.

[0041] The process of obtaining the channel attention map is as follows: Extract the feature map output by the cascaded dilated pyramid module through global average pooling The importance of channels is calculated and the importance distribution of channels is learned using a multi-layer perceptron. This can suppress the noise of irrelevant channels and output the channel attention map through the Sigmoid activation function. , the calculation formula is as follows: , in, is the channel attention map; It is a 3-layer fully connected perception machine layer; is global average pooling; is the Sigmoid activation function; The process of obtaining the spatial attention map is as follows: The feature map output by the cascaded hole pyramid module is processed through a 7×7 convolution operation Processing the spatial dimension and extracting channel dimension features by combining maximum pooling and mean pooling can enhance the abnormal response of local space and output the spatial attention map through the Sigmoid activation function. , the calculation formula is as follows: , in, is the spatial attention map; express Convolution operation; for The maximum pooling feature of the channel dimension; for The channel dimension mean pooling feature; is the Sigmoid activation function; Indicates that the channel dimension is maximized pooled and channel-dimensional mean pooling features Features after cascading.

[0042] In a specific implementation, the operations in the output layer are as follows: In cement slurry images, some samples have fuzzy structures such as blurred boundaries and smooth texture transitions. Traditional Softmax outputs often show overly high confidence predictions on such samples, making it difficult to accurately characterize the uncertainty of the model. Feature map output by the collaborative attention module Processing is performed to obtain the classification prediction probability. First, the feature map Convert it into a one-dimensional vector and input it into the preset fully connected layer to get the original output value of each category ; Then, calculate the feature map The variance in the channel dimension, and based on this variance and a preset scaling factor , calculate the sample related temperature coefficient , the calculation formula is as follows: , in, Representation feature map Variance in the channel dimension; For the scaling factor, set ; Finally, in the standard Softmax function calculation, the sample-related temperature coefficient is used The original output value for each category Scaling is performed to obtain the probability value of the sample prediction for each category. The calculation formula is as follows: , in, The probability value of the sample predicted as the cth category; is the total number of categories; For the The original output value of each category.

[0043] In a specific implementation, the training loss function based on the weighted cross entropy calculation model is as follows: Key areas with inhomogeneity in cement slurry images, such as bubble boundaries and particle aggregation sites, often occupy only a small proportion of the image. Conventional cross-entropy loss functions give the same weight to all areas during training, making it difficult to guide the model to focus on these key feature areas, resulting in limited classification accuracy. Therefore, the present invention is based on a training loss function of a weighted cross-entropy calculation model. For each input cement slurry image, its gradient vector and entropy value are calculated. Then, the maximum value of the gradient norm, the preset gradient norm weight coefficient and the local entropy weight coefficient are combined to calculate the weight factor of the image. Finally, when calculating the cross-entropy loss of all images, the weight factor of each image is used to weight its loss term to obtain the final loss value. , the calculation formula is as follows: , in, is the number of input cement slurry images; is the label of the i-th image belonging to the c-th actual category, specifically 0 or 1, indicating whether it belongs to the category or not; Predict the probability value of the cth category for the i-th image; For the The weight factor for each image.

[0044] For cement slurry images with obvious boundaries or textures, which have the characteristics of high gradient and high entropy, the corresponding sample weight factor is higher, forcing the model to focus on key areas. The weight factor calculation formula is as follows: , in, is the weight coefficient of the gradient norm, set ; is the image gradient vector; Indicates the maximum value of the calculated image gradient; is the gradient vector of the i-th image, which is calculated by the preset Sobel operator. The Sobel level kernel of the preset Sobel operator is , the Sobel vertical kernel is ; The entropy value of the i-th image is used to measure the degree of disorder of the information in the image. The larger the entropy value, the more complex the image. is the weight coefficient of local entropy, set .

[0045] In a specific implementation, S5 is as follows: The cement slurry image dataset that has undergone image acquisition, preprocessing, annotation, and enhancement preprocessing is used as training samples and their corresponding annotation labels. The training process adopts a small batch gradient descent strategy. In each iteration, a small batch of samples is randomly selected from the dataset and input into the model for forward propagation calculation to obtain the prediction results. Then, the error and loss function value between the current batch prediction result and the true label are calculated, and the error backpropagation operation is performed using the backpropagation algorithm to calculate the gradient of the learnable parameters in the model relative to the loss function. The learnable parameters in the model include the convolution kernel weight and bias term; Finally, the stochastic gradient descent method is used to update and adjust all parameters of the model according to the preset learning rate to minimize the loss function and gradually improve the predictive ability of the model. The above process is iterated repeatedly until the preset stop iteration condition is met to obtain a trained model. The stop iteration condition is: 1) Set a maximum training round limit. When the actual training round reaches this preset maximum, training will be forced to stop regardless of the model performance. The upper limit of training rounds is set to 10,000; 2) Monitor the performance of the model on an independent validation set. During training, regularly use a validation set that was not used in training to evaluate the model's classification performance, calculate the model's classification accuracy, or observe the loss value. When the model's performance indicators on the validation set no longer improve or even begin to decline over multiple consecutive rounds, it is determined that the model performance has reached saturation or shows signs of overfitting. At this time, even if the maximum round limit has not been reached, stop training early.

[0046] Example 2 like Figure 5 As shown in Figure 2, the prediction confidence distribution of the traditional classifier and the method of the present invention is compared to solve the problem of distinguishing fuzzy samples of cement slurry boundaries. Figure 5 It shows that the traditional method presents a sharp single peak in the confidence distribution and is biased towards the high-value area, indicating that it has an overconfident prediction defect for fuzzy samples; while the method of the present invention forms a bimodal distribution, with the main peak located in the high confidence area representing the definite judgment of clear samples, and the secondary peak located in the low confidence area reasonably reflecting the uncertainty of fuzzy samples. The probability density of the method of the present invention in the high uncertainty area (0.4-0.6) marked in the figure is significantly higher, and the median mark shifts to the left, proving that the temperature scaling mechanism based on characteristic variance can dynamically soften the probability distribution, so that the model's prediction of fuzzy structures such as uneven cement slurry bonding is more in line with the actual judgment difficulty.

[0047] Example 3 like Figure 6 As shown in the figure, the overall performance of different classification algorithms in the cement slurry uniformity recognition task is evaluated, and the classification accuracy distribution of the traditional support vector machine SVM, conventional convolutional neural network CNN, deep residual network ResNet50, unenhanced model and the present invention is visually compared through box plots. Figure 6 The middle box represents the main distribution range of the data, the horizontal line inside the box represents the median position, and the scattered points outside the box reflect the abnormal fluctuation value. The experimental results show that the box position of the present invention is significantly higher than that of other methods, and the box height is more compact and has fewer outliers, indicating that the present invention not only achieves the highest median classification accuracy, but also has the strongest stability. The performance of the unenhanced model (i.e., the version of the present invention with the multi-scale adaptive enhancement module removed) is significantly lower than that of the complete model, verifying the key role of image enhancement preprocessing in improving the ability to extract microscopic features.

[0048] Although the above describes the specific implementation methods of the invention in conjunction with the accompanying drawings, it does not limit the scope of protection of the invention. Based on the technical solution of the present invention, various modifications or variations that can be made by those skilled in the art without creative work are still within the scope of protection of the present invention.

Claims

1. A method for classifying and detecting cement slurry uniformity, characterized in that: The following steps are involved: S1. Use an industrial camera to photograph a standard cement slurry sample prepared in the laboratory or at the construction site under standard lighting conditions. The captured image must cover the typical interface or surface of the cement slurry to obtain a cement slurry image. S2. Preprocess the collected cement slurry images to remove some noise from the images and unify the data format. Professionals then manually annotate the images according to the preset uniformity level completion standards to form the training dataset. S3, constructing a multi-scale adaptive enhancement function to enhance the cement slurry images in the training dataset; S4. A cement slurry uniformity classification model is constructed based on a deep convolutional neural network. The core structure of the model includes an adaptive convolution layer, a dual-branch module, a cascaded void pyramid module, a collaborative attention module, and an output layer. The enhanced cement slurry image is input into the model for cement slurry uniformity classification prediction. The training loss function of the model is then calculated based on weighted cross entropy. S5. Iteratively train the constructed model until the preset conditions are met and the iteration is stopped to obtain a trained model; S6. Input the new cement slurry image into the trained model to perform cement slurry uniformity classification prediction and obtain the final uniformity classification result.

2. A cement slurry uniformity classification detection method according to claim 1, characterized in that S2 The details are as follows: S2.

1. Preprocessing: First, the collected cement slurry images are uniformly converted into grayscale images or their RGB three-channel information is retained. Then, image size normalization is performed to adjust all cement slurry images to a preset fixed size. The cement slurry images are initially smoothed using a filtering method such as Gaussian filtering or median filtering, ultimately obtaining preprocessed cement slurry images. S2.

2. Manual labeling: The pre-processed cement slurry images are manually labeled based on visual features, including the density and uniformity of particle distribution in the cement slurry images, the number and size distribution of bubbles, and whether there is obvious agglomeration or segregation. The pre-processed cement slurry images are judged and labeled with preset category labels, including highly uniform, generally uniform, slightly uneven, and severely uneven; ultimately, a training dataset is formed.

3. A cement slurry uniformity classification detection method according to claim 2, characterized in that: S3 is as follows: A multi-scale adaptive enhancement function is constructed. The cement slurry image in the input training dataset is converted to the frequency domain through Fourier transform. A high-frequency enhancement term with Laplacian characteristics is constructed based on the frequency domain Gaussian filter function to highlight the edge information of the corresponding frequency position in the cement slurry image. Then, the high-frequency enhancement term is multiplied point by point with the Fourier transform result of the cement slurry image to strengthen the specific components in the frequency domain. The image is then restored to the spatial domain through inverse Fourier transform. At the same time, the directional gradient of the cement slurry image is calculated in the spatial domain. The gradient direction angle is determined based on the local standard deviation to retain the directional information of the macrostructure. The frequency domain enhancement term and the spatial domain gradient are applied to the cement slurry image through element-by-element multiplication to generate the enhanced cement slurry image. The calculation formula is as follows: , in, is the input cement slurry image; is the enhanced cement slurry image; is element-wise multiplication; is the Fourier transform; is the inverse Fourier transform; is a frequency domain Gaussian filter, is the frequency coordinate vector; The input cement slurry image The directional gradient operator, is the gradient direction angle; is the fusion coefficient; is the norm symbol.

4. A cement slurry uniformity classification detection method according to claim 3, characterized in that: The operations in the convolutional layer are as follows: Enhanced cement slurry image Perform convolution operation, the convolution kernel size is not fixed, according to the enhanced cement slurry image The complexity of the local area is dynamically adjusted, and the enhanced cement slurry image For each central pixel position in the image, the local information entropy of the fixed-size neighborhood window centered on it is calculated. Based on the local information entropy value, a linear mapping is performed between the preset minimum kernel size and the maximum kernel size to obtain the kernel expansion coefficient, and the kernel expansion coefficient is used to control the size of the Gaussian kernel function range. An adaptive convolution operation is performed on the enhanced image at the central pixel position to obtain an adaptive convolution feature map. ; The calculation formula in the adaptive convolution layer is as follows: , in, Represents the adaptive convolution operation; is the set of neighborhood pixels covered by the convolution kernel; is the neighborhood pixel position index, is the center pixel position index; The enhanced cement slurry image is shown in The pixel value of the pixel position; is the Gaussian kernel function; For the The kernel dilation coefficient at pixel locations.

5. A cement slurry uniformity classification detection method according to claim 4, characterized in that: The operations in the dual-branch module are as follows: First, the adaptive convolution feature map is processed and fused in two paths to obtain the dual-branch fused feature map; 1) Macro branch: The macro branch will adaptively convolute the feature map Input multiple dilated convolutional layers with different dilation rates to extract global features and obtain a global feature map. ; 2) Micro branches: Microscopic branches for adaptive convolutional feature maps Perform discrete wavelet transform to obtain the feature tensor after discrete wavelet transform ,right Decomposition yields a low-frequency component feature map and three high-frequency component feature maps. The low-frequency component feature map is expressed as , the high-frequency component feature map includes the horizontal high-frequency component feature map , vertical high-frequency component feature map And the diagonal high-frequency component feature map ; Then, the high frequency component feature map After the residual block is refined, it is combined with the global feature map Fusion, get the feature map after dual-branch fusion , the calculation formula is as follows: , in, It is the feature map after dual-branch fusion; is the Sigmoid activation function; is the convolution weight matrix of macro features; For each high-frequency component in the wavelet decomposition, Corresponding to the high-frequency component in the horizontal direction, Corresponding to the high-frequency component in the vertical direction, Corresponding to the high-frequency components in the diagonal direction; is the high-frequency component feature map; is the fusion impact factor; is the convolution weight matrix of high-frequency component features.

6. A cement slurry uniformity classification detection method according to claim 5, characterized in that: The operations in the cascaded hole pyramid module are as follows: The feature map after the two branches are fused Input cascade hollow pyramid module for processing, cascade hollow pyramid module The internal information flow path is bidirectional, and the bidirectional information flow path is parallel computing; Cascaded Hollow Pyramid Module In the above example, each void rate is processed independently and defined as is the void ratio, and , indicating that the void ratios are 1, 3, and 5 respectively; for each void ratio , the cascaded hollow pyramid module uses the same input features, that is, the input features of the cascaded hollow pyramid module are the feature maps after dual-branch fusion , the feature map after dual-branch fusion Feature maps after dilated convolution obtained by dilated convolution with different dilation rates ; Then, the feature map after the dilated convolution After cascading the hollow pyramid module The internal bidirectional information flow path is the upsampling path and the downsampling path, and the feature map after the hole convolution The upsampling path feature map is obtained by going through the upsampling path and the downsampling path respectively. and downsampling path feature map , then and Perform weighted fusion to obtain a bidirectional fusion path feature map ; Finally, the bidirectional fusion path feature map Corresponding void ratio Aggregate all feature maps of the cascaded hole pyramid module to obtain the feature map output by the cascaded hole pyramid module .

7. A cement slurry uniformity classification detection method according to claim 6, characterized in that: The operations in the collaborative attention module are as follows: The feature map output by the cascaded hole pyramid module Apply the attention mechanism to obtain the feature map output by the collaborative attention module The attention mechanism applied includes global average pooling operation, multi-layer perceptron and Sigmoid activation function from The channel attention map extracted from , and the maximum pooling feature from the channel dimension after 7×7 convolution operation and Sigmoid activation function and channel dimension mean pooling features The spatial attention map extracted from ;Will With channel attention map and spatial attention map Feature fusion is performed by element-by-element multiplication to obtain the feature map output by the collaborative attention module , the calculation formula is as follows: , in, This is element-wise multiplication.

8. A cement slurry uniformity classification detection method according to claim 7, characterized in that: The operations in the output layer are as follows: Feature map output by the collaborative attention module Processing is performed to obtain the classification prediction probability. First, the feature map Convert it into a one-dimensional vector and input it into the preset fully connected layer to get the original output value of each category ; Then, calculate the feature map The variance in the channel dimension, and based on this variance and a preset scaling factor , calculate the sample related temperature coefficient , the calculation formula is as follows: , in, Representation feature map Variance in the channel dimension; is the scaling factor; Finally, in the standard Softmax function calculation, the sample-related temperature coefficient is used The original output value for each category Scaling is performed to obtain the probability value of the sample prediction for each category. The calculation formula is as follows: , in, The probability value of the sample predicted as the cth category; is the total number of categories; For the The original output value of each category.

9. A cement slurry uniformity classification detection method according to claim 8, characterized in that: The training loss function based on the weighted cross entropy calculation model is as follows: Based on the training loss function of the weighted cross entropy calculation model, for each input cement slurry image, its gradient vector and entropy value are calculated. Then, the weight factor of the image is calculated by combining the maximum value of the gradient norm, the preset gradient norm weight coefficient and the local entropy weight coefficient. Finally, when calculating the cross entropy loss of all images, the weight factor of each image is used to weight its loss term to obtain the final loss value. , the calculation formula is as follows: , in, is the number of input cement slurry images; is the label of the i-th image belonging to the c-th actual category, specifically 0 or 1, indicating whether it belongs to the category or not; Predict the probability value of the cth category for the i-th image; For the The weight factor for each image.

10. A cement slurry uniformity classification detection method according to claim 9, characterized in that: S5 is as follows: The cement slurry image dataset that has undergone image acquisition, preprocessing, annotation, and enhancement preprocessing is used as training samples and their corresponding annotation labels. The training process adopts a small batch gradient descent strategy. In each iteration, a small batch of samples is randomly selected from the dataset and input into the model for forward propagation calculation to obtain the prediction results. Then, the error and loss function value between the current batch prediction result and the true label are calculated, and the error backpropagation operation is performed using the backpropagation algorithm to calculate the gradient of the learnable parameters in the model relative to the loss function. The learnable parameters in the model include the convolution kernel weight and bias term; Finally, the stochastic gradient descent method is used to update and adjust all parameters of the model according to the preset learning rate to minimize the loss function and gradually improve the predictive ability of the model. The above process is iterated repeatedly until the preset stop iteration condition is met to obtain a trained model. The stop iteration condition is: 1) Set a maximum training round limit. When the actual training round reaches this preset maximum, training will be forced to stop regardless of the model performance; 2) Monitor the performance of the model on an independent validation set. During training, regularly use a validation set that was not used in training to evaluate the model's classification performance, calculate the model's classification accuracy, or observe the loss value. When the model's performance indicators on the validation set no longer improve or even begin to decline over multiple consecutive rounds, it is determined that the model performance has reached saturation or shows signs of overfitting. At this time, even if the maximum round limit has not been reached, stop training early.

Citation Information

Patent Citations

  • Training method of neural network for monitoring bagged cement capacity

    CN112750096A

  • Penaeus vannamei quality detection method based on adaptive convolutional neural network

    CN112907503A

  • Indirect measurement method and system for element content of cement and cement-based material

    CN115409826A

  • Image defogging method based on deep neural network

    CN115689932A

  • Road adhesion coefficient prediction method based on road material identification

    CN117690106A