Coal dirt band identification method and device and coal dirt band identification model training method

By combining feature extraction from latent encoders and diffusion models with feature fusion from Transformer models, the problem of insufficient feature recognition in complex coal interbedded material identification scenarios is solved, achieving high-precision interbedded material identification and localization, applicable to various coal quality inspections in industrial scenarios.

CN122176328APending Publication Date: 2026-06-09YANAN HECAO GOU COAL IND CO LTD +1

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
YANAN HECAO GOU COAL IND CO LTD
Filing Date
2026-02-12
Publication Date
2026-06-09

AI Technical Summary

Technical Problem

Existing coal interbedded gangue identification technologies struggle to accurately identify and locate it under complex lighting conditions and irregular fracture patterns. Traditional methods suffer from insufficient feature recognition capabilities, weak generalization ability, and poor robustness.

Method used

A latent encoder is used to extract features through multi-level residual convolution and stride convolution. Combined with forward noise addition and backward noise reduction processing of the diffusion model, the feature fusion is performed using the multi-resolution encoding and decoding and cross-attention mechanism of the Transformer model to achieve semantic segmentation of the interlocking material.

Benefits of technology

It improves the accuracy and robustness of coal interbedded with gangue, enhances the ability to identify it in complex backgrounds, and has good generalization and applicability, making it suitable for coal quality inspection in actual industrial scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122176328A_ABST
    Figure CN122176328A_ABST
Patent Text Reader

Abstract

This application provides a method, apparatus, and training method for a coal gangue inclusion recognition model, which can be applied to the fields of computer vision and deep learning. The coal gangue inclusion recognition method includes: performing feature extraction processing on the original coal image to obtain initial coal image features; performing forward noise addition processing on the initial coal image features to obtain a noise feature sequence, and performing reverse denoising processing on the noise feature sequence to obtain gangue inclusion prompt features; performing multi-resolution encoding and decoding processing on the original coal image to obtain multi-level encoded features and multi-level decoded features; and, during the skip connection process of the multi-level encoded features and multi-level decoded features, fusing the gangue inclusion prompt features with the multi-level encoded features and multi-level decoded features using a cross-attention mechanism to obtain a gangue inclusion semantic segmentation map representing the gangue inclusion recognition result.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the fields of computer vision and deep learning technology, specifically to a method, apparatus, and training method for a coal interbedded gangue recognition model. Background Technology

[0002] In the coal washing and processing process, the accurate identification and location of intercalations (i.e., rock impurities mixed in with coal) is a key step in improving coal quality and reducing washing costs. Coal and intercalations often have similar appearances, such as small differences in gray scale, similar texture features, and blurred boundaries. Especially in complex lighting conditions (e.g., dim underground environments or uneven industrial lighting) or in scenarios where coal is broken and irregularly shaped, traditional image recognition methods struggle to effectively distinguish between the two, resulting in low recognition accuracy and large positioning errors.

[0003] Existing coal interbedded rock identification technologies mainly fall into two categories: one is based on a two-stage framework, and the other is based on an end-to-end framework. However, both of these technologies suffer from weak identification capabilities for key interbedded rock features (such as texture and edge features) and poor generalization ability. Furthermore, existing deep learning-based coal interbedded rock identification methods suffer from low accuracy and insufficient robustness. Summary of the Invention

[0004] In view of the above problems, this application provides a method, device and training method for coal gangue identification model.

[0005] According to a first aspect of this application, a method for identifying coal interbedded with gangue is provided, comprising: performing feature extraction processing on an original coal image to obtain initial features of the coal image, wherein the initial features of the coal image are used to mark coal regions and gangue regions in the original coal image; performing forward noise processing on the initial features of the coal image to obtain a noise feature sequence, and performing reverse noise reduction processing on the noise feature sequence to obtain gangue-clamping features, wherein the gangue-clamping features represent the distribution information of gangue in the original coal image; performing multi-resolution encoding and decoding processing on the original coal image to obtain multi-level encoding features and multi-level decoding features, and fusing the gangue-clamping features with the multi-level encoding features and multi-level decoding features in a cross-attention mechanism during the skip connection process of the multi-level encoding features and multi-level decoding features to obtain a gangue-clamping semantic segmentation map representing the gangue identification result.

[0006] According to embodiments of this application, the above-mentioned feature extraction processing of the original coal image to obtain initial coal image features includes: using the multi-level residual module of the trained latent encoder to perform multi-round residual convolution processing on the original coal image to obtain multi-level residual convolution features; using the stride convolution module of the trained latent encoder to perform spatial dimension reduction processing on the multi-level residual convolution features through stride convolution operation to obtain dimension-reduced multi-level residual convolution features; using the nonlinear transformation module of the trained latent encoder to perform feature flattening processing on the dimension-reduced multi-level residual convolution features through nonlinear transformation operation to obtain flattened features; and using the multi-level fully connected layer of the trained latent encoder to perform fully connected compression on the flattened features to obtain the initial coal image features.

[0007] According to embodiments of this application, the above-mentioned forward noise addition processing of the initial features of a coal image to obtain a noise feature sequence includes: using the Gaussian noise addition module of a trained diffusion model to iteratively perform a Gaussian distribution-based noise addition operation on the initial features of the coal image, and randomly adjusting the noise variance control parameter during the Gaussian distribution-based noise addition operation until a preset iteration number threshold is met to obtain a noise feature sequence; or using the reparameterization module of a trained diffusion model to reparameterize the initial features of the coal image to obtain a noise feature sequence.

[0008] According to an embodiment of this application, the above-mentioned reverse denoising process of the noise feature sequence to obtain the interbedded coal feature includes: constructing a noise posterior distribution based on the noise feature sequence and the initial features of the coal image, wherein the noise posterior distribution is used to represent the distribution probability of interbedded coal in the original coal image; extracting the noise-feature mapping relationship between the noise feature sequence and the initial features of the coal image using the mapping relationship extraction module of the trained diffusion model according to the noise-feature mapping relationship; estimating the noise in the noise sequence features using the noise estimation module of the trained diffusion model according to the noise-feature mapping relationship to obtain the estimated noise; generating interbedded coal candidate features using the encoding auxiliary module of the trained diffusion model, wherein the interbedded coal candidate features represent the edge information and texture information of the interbedded coal region; and performing reverse denoising process on the noise feature sequence using the denoising module of the trained diffusion model according to the estimated noise and the interbedded coal candidate features to obtain the interbedded coal feature.

[0009] According to embodiments of this application, the above-mentioned multi-resolution encoding and decoding processing of the original coal image to obtain multi-level encoded features and multi-level decoded features includes: extracting features from the original coal image using the feature extraction module of a trained Transformer model to obtain a feature embedding vector, wherein the feature embedding vector represents the gray-level gradient information, edge information, and texture structure information of the original coal image; performing a downsampling operation with progressively decreasing spatial resolution on the feature embedding vector using the multi-level encoder of the trained Transformer model to obtain multi-level encoded features; and performing an upsampling operation with progressively increasing spatial resolution on the multi-level encoded features using the multi-level decoder of the trained Transformer model to obtain multi-level decoded features.

[0010] According to embodiments of this application, the process of skip-connecting multi-level encoded features and multi-level decoded features, and fusing the gutter-clamping hint features with the multi-level encoded features and multi-level decoded features using a cross-attention mechanism to obtain a gutter-clamping semantic segmentation map representing the gutter recognition result, includes: using the skip-connection module of a trained Transformer model to perform skip-connection operations at the same resolution level on the multi-level encoded features and multi-level decoded features to obtain multi-level intermediate features; using the fusion module of a trained Transformer model to project the gutter-clamping hint features to obtain key vectors and value vectors for the cross-attention mechanism; during the skip-connection process, using the fusion module of a trained Transformer model to perform linear transformation on the multi-level intermediate features to obtain multi-level query vectors for the cross-attention mechanism; during the skip-connection process, using the fusion module to segment the multi-level query vector, key vector, and value vector into multiple attention heads, and cross-fusing the multiple attention heads to obtain the gutter-clamping semantic segmentation map.

[0011] According to a second aspect of this application, a training method for a coal interbedded rock recognition model is provided. The coal interbedded rock recognition model includes a latent encoder, a diffusion model, and a Transformer model. The method includes: extracting first image features from coal image samples to label coal regions and interbedded rock regions using the latent encoder; performing a fusion operation based on a cross-attention mechanism on the coal image samples and the first image features using the Transformer model to obtain an interbedded rock semantic segmentation sample map; processing the interbedded rock segmentation labels of the interbedded rock semantic segmentation sample map and the coal image samples using a first mean absolute error loss function to obtain a first loss value; optimizing the parameters of the latent encoder and the Transformer model using the first loss value to obtain a parameter-optimized latent encoder and a parameter-optimized Transformer model; iteratively performing feature extraction, fusion, first loss value acquisition, and parameter optimization operations until a first preset training condition is met to obtain a trained latent encoder and a trained Transformer model.

[0012] According to an embodiment of this application, the training method of the coal interbedded gangue recognition model further includes: using a diffusion model to process noise in the first image features extracted from the trained latent encoding to obtain a second image feature of gangue distribution information in the coal image sample; using a second mean absolute error loss function to process the second image feature and the gangue hint label of the coal image sample to obtain a second loss value; using the second loss value to perform a parameter dynamic optimization operation based on singular value decomposition on the diffusion model to obtain an optimized diffusion model; iteratively performing noise processing operation, second loss value acquisition operation and parameter dynamic optimization operation based on singular value decomposition until a second preset training condition is met to obtain a trained diffusion model, thereby completing the training of the coal interbedded gangue model, wherein the trained coal interbedded gangue recognition model is applied to the coal interbedded gangue recognition method.

[0013] According to an embodiment of this application, the above-mentioned method of performing dynamic parameter optimization based on singular value decomposition on the diffusion model using a second loss value to obtain an optimized diffusion model includes: performing a singular value decomposition operation on the multidimensional weight matrix of the diffusion model to obtain a singular value diagonal matrix; calculating the sensitivity coefficient of each singular value in the singular value diagonal matrix using the second loss value; calculating the sensitivity coefficients of all singular values ​​to obtain a dynamic threshold; performing parameter optimization based on gradient update and regularization constraints on the diffusion model when the sensitivity coefficient of the singular values ​​is greater than the dynamic threshold to obtain an optimized diffusion model; and performing parameter decay operation on the diffusion model when the sensitivity coefficient of the singular values ​​is less than or equal to the dynamic threshold to obtain an optimized diffusion model.

[0014] According to a third aspect of this application, a coal interbedded rock identification device is provided, comprising: a latent feature extraction module, used to perform feature extraction processing on an original coal image to obtain initial features of the coal image, wherein the initial features of the coal image are used to mark coal regions and interbedded rock regions in the original coal image; a noise processing module, used to perform forward noise addition processing on the initial features of the coal image to obtain a noise feature sequence, and to perform reverse noise reduction processing on the noise feature sequence to obtain interbedded rock indication features, wherein the interbedded rock indication features represent the distribution information of interbedded rock in the original coal image; and an interbedded rock identification module, used to perform multi-resolution encoding and decoding processing on the original coal image to obtain multi-level encoded features and multi-level decoded features, and during the process of skip connection of the multi-level encoded features and multi-level decoded features, to fuse the interbedded rock indication features with the multi-level encoded features and multi-level decoded features in a cross-attention mechanism to obtain an interbedded rock semantic segmentation map representing the interbedded rock identification result.

[0015] A fourth aspect of this application provides an electronic device comprising: one or more processors; and a memory for storing one or more computer programs, wherein the one or more processors execute the one or more computer programs to implement the steps of the method described above.

[0016] A fifth aspect of this application also provides a computer-readable storage medium having a computer program or instructions stored thereon, which, when executed by a processor, implement the steps of the above-described method.

[0017] A sixth aspect of this application also provides a computer program product, including a computer program or instructions that, when executed by a processor, implement the steps of the above-described method.

[0018] The coal gangue inclusion recognition method provided in this application achieves high-precision recognition of coal gangue inclusions by integrating feature extraction, noise addition and denoising processing, multi-resolution encoding and decoding, and a cross-attention mechanism. Furthermore, this method extracts features from the original coal image, obtaining initial features that can label both coal and gangue inclusion regions, comprehensively capturing key information from the image and laying the foundation for subsequent recognition. The method enhances feature representation capabilities through forward noise addition and reverse denoising, improving the model's sensitivity to gangue inclusion regions and enhancing feature recognition accuracy. The multi-resolution encoding and decoding structure effectively captures both local and global information, improving segmentation accuracy. The cross-attention mechanism fuses gangue inclusion clue features with encoded and decoded features, enhancing the model's ability to recognize gangue inclusions in complex backgrounds and effectively solving the problem of information fragmentation. In addition, the coal gangue inclusion recognition method provided in this application has good generalizability and scalability, making it applicable to various coal quality inspection needs in real-world industrial scenarios. Attached Figure Description

[0019] The above-mentioned contents, other objects, features and advantages of this application will become clearer from the following description of embodiments with reference to the accompanying drawings, in which:

[0020] Figure 1 The diagram illustrates an application scenario of the coal interbedded gangue identification method according to an embodiment of this application.

[0021] Figure 2 A flowchart of a coal interbedded gangue identification method according to an embodiment of this application is shown.

[0022] Figure 3 A training and inference architecture diagram of a coal interbedded gangue identification model according to an embodiment of this application is shown.

[0023] Figure 4 A structural block diagram of a coal gangue identification device according to an embodiment of this application is shown.

[0024] Figure 5 A block diagram of an electronic device suitable for implementing a coal interbedded gangue identification method according to an embodiment of this application is shown. Detailed Implementation

[0025] The embodiments of this application will now be described with reference to the accompanying drawings. However, it should be understood that these descriptions are exemplary only and are not intended to limit the scope of this application. In the following detailed description, numerous specific details are set forth to provide a thorough understanding of the embodiments of this application for ease of explanation. However, it will be apparent that one or more embodiments may be implemented without these specific details. Furthermore, descriptions of well-known structures and technologies are omitted in the following description to avoid unnecessarily obscuring the concepts of this application.

[0026] The terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit the scope of this application. The terms “comprising,” “including,” etc., as used herein indicate the presence of the stated features, steps, operations, and / or components, but do not exclude the presence or addition of one or more other features, steps, operations, or components.

[0027] All terms used herein (including technical and scientific terms) have the meanings commonly understood by those skilled in the art, unless otherwise defined. It should be noted that the terms used herein are to be interpreted in a manner consistent with the context of this specification, and not in an idealized or overly rigid way.

[0028] When using expressions such as "at least one of A, B and C", they should generally be interpreted in accordance with the meaning that is commonly understood by those skilled in the art (e.g., "a system having at least one of A, B and C" should include, but is not limited to, a system having A alone, a system having B alone, a system having C alone, a system having A and B, a system having A and C, a system having B and C, and / or a system having A, B and C, etc.).

[0029] Existing coal interbedded rock recognition technologies mainly include two-stage framework-based methods and end-to-end framework-based methods. Two-stage framework-based methods first enhance the coal image's features (e.g., contrast enhancement, noise suppression), then perform recognition and localization using object detection or semantic segmentation models. However, these methods suffer from the drawback of separating feature enhancement and recognition / localization processes, often resulting in enhancements that fail to meet the subsequent recognition task's requirements for key interbedded rock features (texture, edges), thus limiting overall performance. End-to-end framework-based methods integrate feature enhancement and interbedded rock recognition into a unified model with full fine-tuning. However, existing end-to-end models overly rely on the distribution characteristics of specific datasets, exhibiting weak generalization ability and unstable performance across different coal types and interbedded rock types. Furthermore, deep learning-based methods for identifying coal inclusions also suffer from several drawbacks: First, while traditional diffusion models can generate clear features through progressive denoising, the generated feature cues are not robust enough to the distribution differences between coal and inclusions in scenarios where their features are similar, easily leading to confusion of target features. Second, conventional Transformer models lack efficient feature fusion mechanisms, making it difficult to fully capture the subtle edge texture features of inclusions, resulting in low localization accuracy. Finally, existing model training strategies often employ a single loss function, failing to balance the effectiveness of feature enhancement with the accuracy of inclusion identification, further impacting overall performance in complex scenarios. Therefore, there is an urgent need for a coal inclusion identification and localization method that can address the issues of information fragmentation, weak generalization ability, low feature recognition, and the contradiction between training and optimization, to meet the practical needs of industrial scenarios.

[0030] To address the aforementioned issues, this application provides a coal interbedded gangue identification method, apparatus, and training method for a coal interbedded gangue identification model. The main objectives are: to solve the problems of feature enhancement and identification localization separation, and weak generalization ability of the end-to-end framework in coal interbedded gangue identification methods based on a two-stage framework, by constructing a unified and transferable framework of fusion diffusion model and enhancement Transformer to achieve collaborative adaptation of feature optimization and identification localization; to address the problem of insufficient robustness of feature cues generated by traditional diffusion models to the distribution differences between coal and gangue, by dynamically optimizing the trainable weights of the diffusion model to improve the recognition accuracy of cues for key gangue features; to address the problems of low feature fusion efficiency and insufficient capture of subtle gangue features in conventional Transformer models, by designing a feature fusion module based on cross-attention to achieve efficient integration of original image features and diffusion cues features; and to address the problem that existing model training strategies cannot simultaneously consider multi-task performance, by proposing a two-stage training process to optimize different modules and ensure optimal performance for feature enhancement, cues generation, and identification localization.

[0031] Figure 1 The diagram illustrates an application scenario of the coal interbedded gangue identification method according to an embodiment of this application.

[0032] like Figure 1 As shown, application scenario 100 according to this embodiment may include scenarios such as computer vision and deep learning. Network 104 is used as a medium to provide a communication link between the first terminal device 101, the second terminal device 102, the third terminal device 103, and the server 105. Network 104 may include various connection types, such as wired or wireless communication links or fiber optic cables, etc.

[0033] Users can use the first terminal device 101, the second terminal device 102, and the third terminal device 103 to interact with the server 105 via the network 104 to receive or send messages, etc. Various communication client applications can be installed on the first terminal device 101, the second terminal device 102, and the third terminal device 103, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients, social media platform software, etc. (for example only).

[0034] The first terminal device 101, the second terminal device 102, and the third terminal device 103 can be various electronic devices with displays and support web browsing, including but not limited to smartphones, tablets, laptops, and desktop computers.

[0035] Server 105 can be a server that provides various services, such as a backend management server that supports websites browsed by users using the first terminal device 101, the second terminal device 102, and the third terminal device 103 (this is just an example). The backend management server can analyze and process data such as received user requests, and feed back the processing results (such as web pages, information, or data obtained or generated according to user requests) to the terminal devices.

[0036] It should be noted that the coal gangue identification method provided in this application embodiment can generally be executed by server 105. Correspondingly, the coal gangue identification device provided in this application embodiment can generally be installed in server 105. The coal gangue identification method provided in this application embodiment can also be executed by a server or server cluster that is different from server 105 and capable of communicating with the first terminal device 101, the second terminal device 102, the third terminal device 103, and / or server 105. Correspondingly, the coal gangue identification device provided in this application embodiment can also be installed in a server or server cluster that is different from server 105 and capable of communicating with the first terminal device 101, the second terminal device 102, the third terminal device 103, and / or server 105.

[0037] It should be understood that Figure 1 The number of terminal devices, networks, and servers shown is merely illustrative. Depending on implementation needs, any number of terminal devices, networks, and servers can be included.

[0038] The following will be based on Figure 1 The described scene, through Figure 2 and Figure 3 The coal interbedded gangue identification method of the embodiments of this application will be described in detail.

[0039] Figure 2 A flowchart of a coal interbedded gangue identification method according to an embodiment of this application is shown.

[0040] like Figure 2 As shown, the coal interbedded with gangue identification in this embodiment includes operations S210 to S230.

[0041] In operation S210, feature extraction processing is performed on the original coal image to obtain initial features of the coal image, which are used to mark the coal region and the interbedded gangue region in the original coal image.

[0042] The above-described feature extraction of raw coal images, for example, utilizes the latent encoder in a trained coal interbedded rock recognition model: The latent encoder first obtains low-level features of the raw coal image through shallow convolutional operations (low-level features refer to features describing local grayscale changes, edge information, and basic texture structure of the raw coal image); then, the low-level features are latently encoded to obtain intermediate feature representations that characterize the initial differences between coal and interbedded rock regions in the raw coal image; finally, these intermediate feature representations are mapped to a low-dimensional latent space to obtain initial features. These initial features retain the main structural differences between coal and interbedded rock in the compressed space. By compressing the raw coal image into a compact feature vector, the latent encoder highlights the initial feature differences between coal and interbedded rock, providing a foundation for subsequent prompt generation.

[0043] In operation S220, the initial features of the coal image are subjected to forward noise addition processing to obtain a noise feature sequence, and the noise feature sequence is subjected to reverse noise reduction processing to obtain the interbedded rock feature, wherein the interbedded rock feature represents the distribution information of interbedded rock in the original coal image.

[0044] The above-mentioned forward denoising and reverse denoising processes are applied to the initial features of coal images. For example, a diffusion model based on a trained coal interbedded rock recognition model is used to perform forward denoising and reverse denoising on the initial features of the coal image. Through the forward denoising and reverse denoising processes, the diffusion model generates multiple sets of feature cues that enhance the key features of interbedded rock (such as edge structures and texture features), thereby improving target recognition.

[0045] In operation S230, the original coal image is processed by multi-resolution encoding and decoding to obtain multi-level encoded features and multi-level decoded features. During the process of skip connection between the multi-level encoded features and multi-level decoded features, the coal inclusion prompt features are fused with the multi-level encoded features and multi-level decoded features in the form of a cross-attention mechanism to obtain a coal inclusion semantic segmentation map representing the coal inclusion recognition result.

[0046] The process of obtaining the semantic segmentation map of coal gangue described above can, for example, use the Transformer model of a trained coal gangue recognition model. This Transformer model uses a hierarchical encoder-decoder structure and integrates the original image features and diffusion cue features through a cross-attention fusion module to complete the semantic segmentation (i.e., gangue recognition) of gangue and the pixel-level localization of gangue.

[0047] The coal gangue inclusion recognition method provided in this application achieves high-precision recognition of coal gangue inclusions by integrating feature extraction, noise addition and denoising processing, multi-resolution encoding and decoding, and a cross-attention mechanism. Furthermore, this method extracts features from the original coal image, obtaining initial features that can label both coal and gangue inclusion regions, comprehensively capturing key information from the image and laying the foundation for subsequent recognition. The method enhances feature representation capabilities through forward noise addition and reverse denoising, improving the model's sensitivity to gangue inclusion regions and enhancing feature recognition accuracy. The multi-resolution encoding and decoding structure effectively captures both local and global information, improving segmentation accuracy. The cross-attention mechanism fuses gangue inclusion clue features with encoded and decoded features, enhancing the model's ability to recognize gangue inclusions in complex backgrounds and effectively solving the problem of information fragmentation. In addition, the coal gangue inclusion recognition method provided in this application has good generalizability and scalability, making it applicable to various coal quality inspection needs in real-world industrial scenarios.

[0048] According to embodiments of this application, the above-mentioned feature extraction processing of the original coal image to obtain initial coal image features includes: using the multi-level residual module of the trained latent encoder to perform multi-round residual convolution processing on the original coal image to obtain multi-level residual convolution features; using the stride convolution module of the trained latent encoder to perform spatial dimension reduction processing on the multi-level residual convolution features through stride convolution operation to obtain dimension-reduced multi-level residual convolution features; using the nonlinear transformation module of the trained latent encoder to perform feature flattening processing on the dimension-reduced multi-level residual convolution features through nonlinear transformation operation to obtain flattened features; and using the multi-level fully connected layer of the trained latent encoder to perform fully connected compression on the flattened features to obtain the initial coal image features.

[0049] The embodiments of this application effectively capture multi-level feature information of images through multi-level residual modules, thereby improving feature representation capabilities; reduce spatial dimension through stride convolution modules, thereby reducing computational complexity while retaining key features; and achieve efficient feature compression and abstraction through a combination of nonlinear transformation and fully connected layers, thereby improving recognition accuracy.

[0050] The following detailed description of the process for extracting initial image features using a trained latent encoder is provided through specific implementation methods.

[0051] The trained latent encoder performs feature compression on the original coal image, preserving key structural information of the coal and interbedded gangue, while reducing the computational complexity of subsequent modules.

[0052] The input to the trained latent encoder is the original image of coal, i.e. ,in, Represents the original image of coal. The original image height of the coal. The original image width of the coal. Represents a three-dimensional real space, where 3 is the number of RGB (R-Red, G-Green, B-Blue) channels in the original coal image.

[0053] The trained latent encoder is structured using multiple (e.g., 6) residual blocks in a concatenated structure. Each residual block includes a convolutional layer (e.g., Conv 3×3), a batch normalization layer (BatchNorm), and an activation function (e.g., Leaky ReLU with leakage correction linear units). Finally, by rearranging the pixel blocks in the acquired image tensor (i.e., pixel-unshuffle operation), the information in the original spatial dimension (i.e., height and width) is transferred to the channel dimension, thereby reducing the spatial dimension size and increasing the channel dimension size.

[0054] The output of the trained latent encoder is a compact set of initial features from the coal image. ,in, That is, the number of channels has been increased to 256 dimensions.

[0055] According to embodiments of this application, the above-mentioned forward noise addition processing of the initial features of a coal image to obtain a noise feature sequence includes: using the Gaussian noise addition module of a trained diffusion model to iteratively perform a Gaussian distribution-based noise addition operation on the initial features of the coal image, and randomly adjusting the noise variance control parameter during the Gaussian distribution-based noise addition operation until a preset iteration number threshold is met to obtain a noise feature sequence; or using the reparameterization module of a trained diffusion model to reparameterize the initial features of the coal image to obtain a noise feature sequence.

[0056] The above embodiments of this application, for example, use a diffusion model of a trained coal interbedded gangue identification model to perform forward noise addition.

[0057] The aforementioned forward noise addition process in this application dynamically adjusts the noise intensity by combining a Gaussian noise addition module with randomly adjusted noise variance control parameters, thereby enhancing the model's robustness to noise. The use of a reparameter module to process features enhances the model's generalization ability while maintaining the semantic integrity of the features. Through noise addition, the coal interbedded rock recognition model can better learn the potential features of the interbedded rock regions in the image during training, thus improving recognition accuracy.

[0058] The forward noise processing process provided in the embodiments of this application will be further described in detail below through specific implementation methods.

[0059] The diffusion model simulates complex scene interference by adding noise forward, and then restores and enhances the key features of the interstitial rocks by denoising backward, generating high-quality feature hints.

[0060] The forward noise addition process is based on the initial features of the coal image output by the latent encoder. ,pass Iteratively add Gaussian noise to construct a noise feature sequence. Each noise addition process follows a Gaussian distribution, the purpose of which is to simulate feature interference in complex scenes (such as lighting noise, texture confusion), and each noise addition process follows a Gaussian distribution as shown in formula (1):

[0061] (1).

[0062] in, For the first Step noise variance control parameters, The effect increases slowly with the number of steps (e.g., linearly from 0.1 to 0.99 with the number of steps), while the simulated disturbance is amplified. It is the identity matrix. Indicates a Gaussian distribution. This represents the noise characteristics at step t. This represents the noise features at step t-1. Through reparameterization derivation, these features can be directly derived from the initial features. Generate the first The noise characteristics of each step are used to avoid redundant calculations in step-by-step iterations, as shown in formula (2):

[0063] (2).

[0064] in, It is used to quantify the correlation between initial features and noise features.

[0065] According to an embodiment of this application, the above-mentioned reverse denoising process of the noise feature sequence to obtain the interbedded coal feature includes: constructing a noise posterior distribution based on the noise feature sequence and the initial features of the coal image, wherein the noise posterior distribution is used to represent the distribution probability of interbedded coal in the original coal image; extracting the noise-feature mapping relationship between the noise feature sequence and the initial features of the coal image using the mapping relationship extraction module of the trained diffusion model according to the noise-feature mapping relationship; estimating the noise in the noise sequence features using the noise estimation module of the trained diffusion model according to the noise-feature mapping relationship to obtain the estimated noise; generating interbedded coal candidate features using the encoding auxiliary module of the trained diffusion model, wherein the interbedded coal candidate features represent the edge information and texture information of the interbedded coal region; and performing reverse denoising process on the noise feature sequence using the denoising module of the trained diffusion model according to the estimated noise and the interbedded coal candidate features to obtain the interbedded coal feature.

[0066] The above embodiments of this application, for example, use a diffusion model of a trained coal interbedded gangue identification model to perform a reverse denoising operation.

[0067] The embodiments described above in this application, by constructing a noise posterior distribution, can accurately represent the distribution probability of interbedded rock in coal images, thereby improving positioning accuracy; by utilizing a mapping relationship module to accurately capture the correspondence between noise features and original features, the feature expression capability is enhanced; by using a noise estimation module to accurately estimate noise, a reliable foundation is provided for subsequent denoising processing; the encoding auxiliary module effectively extracts the edge and texture information of the interbedded rock region, enhancing the discriminative power of the features; and by combining a denoising module that estimates noise and candidate features, noise interference can be effectively removed, and high-quality interbedded rock indication features can be extracted.

[0068] The reverse denoising process provided in this application will be further described in detail below through specific implementation methods.

[0069] Key features of interbedded rock are recovered and enhanced from noise characteristics, and a posterior distribution is introduced. (Based on noise features and initial features, the distribution of interbedded rock features is derived), as shown in formula (3):

[0070] (3).

[0071] The mean is calculated as shown in formula (4):

[0072] (4).

[0073] in, for The noise components in the coal (including redundant features that interfere with the distinction between coal and interbedded gangue) are identified. A noise reduction network is designed. Noise estimation ,in For auxiliary encoder (with potential encoder) The architecture is consistent, focusing on extracting features from candidate regions of interstitial coal inclusions. The generated features are then used for reverse denoising as shown in formula (5).

[0074] (5).

[0075] Through T-step reverse iteration, redundant features are gradually eliminated, and the edge and texture features of the rock inclusions are enhanced, generating multiple sets of rock inclusion feature prompts for subsequent identification and localization.

[0076] According to embodiments of this application, the above-mentioned multi-resolution encoding and decoding processing of the original coal image to obtain multi-level encoded features and multi-level decoded features includes: extracting features from the original coal image using the feature extraction module of a trained Transformer model to obtain a feature embedding vector, wherein the feature embedding vector represents the gray-level gradient information, edge information, and texture structure information of the original coal image; performing a downsampling operation with progressively decreasing spatial resolution on the feature embedding vector using the multi-level encoder of the trained Transformer model to obtain multi-level encoded features; and performing an upsampling operation with progressively increasing spatial resolution on the multi-level encoded features using the multi-level decoder of the trained Transformer model to obtain multi-level decoded features.

[0077] The embodiments described above in this application acquire multi-level coding features and multi-level decoding features, for example, by using the Transformer model of a trained coal interbedded gangue identification model to acquire multi-level coding features and multi-level decoding features.

[0078] The embodiments described above can effectively capture the grayscale gradient information, edge information, and texture structure information of coal images; through downsampling and upsampling operations of multi-level encoders and decoders, feature extraction and reconstruction at different spatial resolution levels are realized, enhancing the model's ability to perceive multi-scale coal inclusion features; the layer-by-layer downsampling and upsampling operations enable the model to analyze image features from coarse to fine, improving the accuracy of coal inclusion recognition.

[0079] According to embodiments of this application, the process of skip-connecting multi-level encoded features and multi-level decoded features, and fusing the gutter-clamping hint features with the multi-level encoded features and multi-level decoded features using a cross-attention mechanism to obtain a gutter-clamping semantic segmentation map representing the gutter recognition result, includes: using the skip-connection module of a trained Transformer model to perform skip-connection operations at the same resolution level on the multi-level encoded features and multi-level decoded features to obtain multi-level intermediate features; using the fusion module of a trained Transformer model to project the gutter-clamping hint features to obtain key vectors and value vectors for the cross-attention mechanism; during the skip-connection process, using the fusion module of a trained Transformer model to perform linear transformation on the multi-level intermediate features to obtain multi-level query vectors for the cross-attention mechanism; during the skip-connection process, using the fusion module to segment the multi-level query vector, key vector, and value vector into multiple attention heads, and cross-fusing the multiple attention heads to obtain the gutter-clamping semantic segmentation map.

[0080] The above embodiments of this application obtain the semantic segmentation map of interbedded coal gangue, for example, by using the Transformer model of a trained coal gangue identification model to obtain the semantic segmentation map of interbedded coal gangue.

[0081] The embodiments described above in this application achieve feature fusion at the same resolution level between the encoder and decoder through a skip connection module, preserving the detailed information of the original image; they utilize a cross-attention mechanism to deeply fuse the chip-clamping prompt features with multi-scale encoding and decoding features, enhancing the model's ability to perceive chip-clamping regions; they segment the query vector, key vector, and value vector into multiple attention heads and perform cross-fusion, improving the model's feature representation ability and generalization performance; they perform projection processing on the chip-clamping prompt features, enabling them to interact with the encoding and decoding features in a unified vector space; and they fully utilize the semantic information of multi-level encoding and decoding features to improve the accuracy and robustness of chip-clamping recognition.

[0082] The data processing procedure of the Transformer model provided in this application will be further explained in detail below through specific implementation methods.

[0083] The Transformer model provided in this application adopts an encoder-decoder architecture: it uses Restormer (an efficient Transformer model designed specifically for high-resolution image restoration tasks, which can significantly reduce computational complexity while maintaining strong restoration capabilities and is suitable for various image restoration tasks such as image denoising, deblurring, and deraining) as the basic recognition and localization model. First, it extracts low-level feature embeddings (such as gray-level gradients and basic textures) from the original coal image through convolutional layers; then, it uses a symmetrical hierarchical encoder-decoder structure to process the features, realizing the transition from coarse localization to fine localization of coal inclusions.

[0084] Encoder: Gradually reduce the feature space resolution (e.g., 256×256→128×128→64×64→32×32) while increasing the channel dimension (e.g., 3→64→128→256→512). Each level contains a fusion module and multiple Transformer blocks. Deeper levels are configured with more Transformer blocks (e.g., 2 in shallow layers and 4 in deep layers) to capture subtle differences in the features of interbedded gangue and coal.

[0085] Decoder: Progressively recovers high-resolution features (e.g., 32×32→64×64→128×128→256×256), and concatenates them with the encoder features of the corresponding level through skip connections, utilizing... Convolution aligns the channel dimensions to ensure that key features of the grit are not lost during resolution restoration, and finally outputs a grit semantic segmentation map with the same size as the original image.

[0086] The cross-attention fusion module integrates diffusion cues (enhanced interstitial features) and intermediate features (features extracted from the original image) through a cross-attention mechanism, achieving accurate transmission of interstitial features. Let the intermediate features... , ( The original spatial resolution of the coal image. (For the number of channels), first reshape it to (Flattened to sequence features), and a query is generated through linear transformation. (Focus on the candidate region to be identified); simultaneously provide diffusion hints. (Enhanced interbedded features) Projected as a bond (Interlocking feature template) and value (Details of the interbedded rock features), as shown in formula (6):

[0087] (6).

[0088] in, These are the learnable parameters for the linear layer (adapted to coal and interbedded gangue features through training). The region is divided into multiple attention heads, and cross-attention is calculated to match the candidate region with the feature of the interstitial region, as shown in formula (7):

[0089] (7).

[0090] Finally, the attention output (the matched interstitial features) is projected and compared with the original intermediate features. The features are added together to obtain the fused features, which are then used in subsequent Transformer blocks to further optimize the discriminative power of the interstitial features.

[0091] According to a second aspect of this application, a training method for a coal interbedded rock recognition model is provided. The coal interbedded rock recognition model includes a latent encoder, a diffusion model, and a Transformer model. The method includes: extracting first image features from coal image samples to label coal regions and interbedded rock regions using the latent encoder; performing a fusion operation based on a cross-attention mechanism on the coal image samples and the first image features using the Transformer model to obtain an interbedded rock semantic segmentation sample map; processing the interbedded rock segmentation labels of the interbedded rock semantic segmentation sample map and the coal image samples using a first mean absolute error loss function to obtain a first loss value; optimizing the parameters of the latent encoder and the Transformer model using the first loss value to obtain a parameter-optimized latent encoder and a parameter-optimized Transformer model; iteratively performing feature extraction, fusion, first loss value acquisition, and parameter optimization operations until a first preset training condition is met to obtain a trained latent encoder and a trained Transformer model.

[0092] According to an embodiment of this application, the training method of the coal interbedded gangue recognition model further includes: using a diffusion model to process noise in the first image features extracted from the trained latent encoding to obtain a second image feature of gangue distribution information in the coal image sample; using a second mean absolute error loss function to process the second image feature and the gangue hint label of the coal image sample to obtain a second loss value; using the second loss value to perform a parameter dynamic optimization operation based on singular value decomposition on the diffusion model to obtain an optimized diffusion model; iteratively performing noise processing operation, second loss value acquisition operation and parameter dynamic optimization operation based on singular value decomposition until a second preset training condition is met to obtain a trained diffusion model, thereby completing the training of the coal interbedded gangue model, wherein the trained coal interbedded gangue recognition model is applied to the coal interbedded gangue recognition method.

[0093] The following describes specific implementation methods in conjunction with appendices. Figure 3 The training process of the coal interbedded gangue identification model provided in this application is explained in further detail.

[0094] Figure 3 A training and inference architecture diagram of a coal interbedded gangue identification model according to an embodiment of this application is shown.

[0095] like Figure 3 As shown, the coal interbedded gangue recognition model provided in this application is based on a transferable and diffusible Transformer architecture, which includes three major modules: latent encoder, diffusive model, and Transformer model. It shows the entire process of original coal image from feature compression, interbedded gangue hint generation to recognition and localization.

[0096] To balance the performance of feature enhancement, cue generation, and recognition / localization, a two-stage training process is designed, optimized using a combined loss function:

[0097] (1) First stage: pre-training the latent encoder and augmenting the Transformer (i.e., the Transformer model, hereinafter the same):

[0098] 1. Training objective: To optimize the feature compression capability of the latent encoder and enhance the basic recognition and localization capability of the Transformer;

[0099] 2. Loss function: [Using...] Loss function, used to calculate the segmentation map that enhances the Transformer output. Pixel-level error compared to the actual labeled image Y: ;

[0100] 3. Training details: 150K iterations, batch size 4, initial learning rate Cosine annealing strategy is used for attenuation.

[0101] (2) Second stage: Jointly train the denoising diffusion model (i.e., the diffusion model, hereinafter the same):

[0102] 1. Training objective: To optimize the prompt generation quality of the denoising diffusion model and achieve the adaptation of prompt features to the recognition and localization task;

[0103] 2. Loss Function: A combined loss function is used, which includes prompt generation loss and identification / localization loss. in ,in, Ideal cue features generated for real-world labeled maps. The prompt features generated for the model;

[0104] 3. Training details: 150K iterations, batch size 4, learning rate We continue to use the cosine annealing strategy, optimizing only the parameters of the denoising diffusion model and the fusion module, while freezing the backbone network parameters of the potential encoder and the enhanced Transformer.

[0105] (III) Model Inference Process:

[0106] 1. Input the original image of the coal. Initial features are generated through a latent encoder. ;

[0107] 2. Denoising diffusion model Perform 8 steps of forward noise addition and reverse noise reduction to generate 16 sets of interstitial rock feature hints Z;

[0108] 3. Enhance the extraction of low-level features from the original image by the Transformer's convolutional layers, and integrate them through a hierarchical encoder-decoder fusion module and cross-attention. With image features;

[0109] Output semantic segmentation graph The class probability of each pixel is obtained through the Softmax function. Pixels with a probability greater than 0.5 are identified as "rock inclusions", thus realizing the identification and pixel-level localization of rock inclusions.

[0110] According to an embodiment of this application, the above-mentioned method of performing dynamic parameter optimization based on singular value decomposition on the diffusion model using a second loss value to obtain an optimized diffusion model includes: performing a singular value decomposition operation on the multidimensional weight matrix of the diffusion model to obtain a singular value diagonal matrix; calculating the sensitivity coefficient of each singular value in the singular value diagonal matrix using the second loss value; calculating the sensitivity coefficients of all singular values ​​to obtain a dynamic threshold; performing parameter optimization based on gradient update and regularization constraints on the diffusion model when the sensitivity coefficient of the singular values ​​is greater than the dynamic threshold to obtain an optimized diffusion model; and performing parameter decay operation on the diffusion model when the sensitivity coefficient of the singular values ​​is less than or equal to the dynamic threshold to obtain an optimized diffusion model.

[0111] The optimization process of the diffusion model provided in this application will be further explained in detail below through specific implementation methods.

[0112] To improve the robustness of feature suggestions to the differences in coal and gangue distribution, the weight matrix of the denoising diffusion model (i.e., the diffusion model) is decomposed by SVD (Singular Value Decomposition) and dynamically optimized.

[0113] (1) Weight matrix decomposition:

[0114] Fully connected layer: directly applies to the 2D weight matrix Perform SVD decomposition to obtain ;

[0115] Convolutional layers: 4D weights ( The height of the convolution kernel. The width of the convolution kernel. Input the number of channels. (To determine the number of output channels), first flatten the spatial dimension and input channel dimension into a 2D matrix. Then perform SVD decomposition. ;

[0116] Decomposition results: (Left singular vector) (Right singular vector) (Singular value diagonal matrix, where s is the number of singular values).

[0117] (2) Dynamic update strategy: Calculate each singular value Sensitivity coefficient .in The gradient of the loss function for the original weight matrix;

[0118] Take all The median is used as the dynamic threshold;

[0119] right Singular values ​​exceeding the threshold (sensitive to distribution differences) are updated as follows: ;

[0120] For singular values ​​of γ less than or equal to the threshold (encoding stable structural features), only weight decay is performed: ,in: (Learning rate) (Weight decay coefficient) It is a symbolic function.

[0121] The coal interbedded rock identification method and its training method provided in this application address the problems of information fragmentation and weak generalization ability: A two-stage framework is used to collaboratively optimize feature enhancement, prompt generation, and identification localization. Combined with the SVD parameter dynamic optimization mechanism, the model's adaptability to different coal types, interbedded rock types, and lighting conditions is improved by more than 30%, and its generalization ability is significantly better than existing end-to-end models. The method also improves the discriminative power of interbedded rock features: After SVD optimization, the feature prompts generated by the denoising diffusion model can accurately enhance key features such as interbedded rock edges and textures, improving the feature differentiation between coal and interbedded rock and effectively avoiding target confusion. Furthermore, the method achieves efficient feature fusion and accurate localization: The cross-attention fusion module can fully integrate original image features and prompt features, improving the accuracy of interbedded rock localization compared to existing Transformer models. Finally, the method balances training stability and industrial applicability: The two-stage training strategy and combined loss function ensure improved model training convergence speed, while the local fine-tuning mechanism reduces the number of model parameters and increases inference speed, meeting the real-time processing requirements of industrial scenarios.

[0122] Based on the above-mentioned method for identifying coal interbedded with gangue, this application also provides a device for identifying coal interbedded with gangue. The following will be combined with... Figure 4 The device is described in detail.

[0123] Figure 4 A structural block diagram of a coal gangue identification device according to an embodiment of this application is shown.

[0124] like Figure 4 As shown, the coal interbedded gangue identification device 400 of this embodiment includes a potential feature extraction module 410, a noise processing module 420, and an interbedded gangue identification module 430.

[0125] The latent feature extraction module 410 is used to perform feature extraction processing on the original coal image to obtain initial features of the coal image, wherein the initial features of the coal image are used to mark the coal region and the interbedded rock region in the original coal image; in one embodiment, the latent feature extraction module 410 can be used to perform the operation S210 described above, which will not be repeated here.

[0126] The noise processing module 420 is used to perform forward noise addition processing on the initial features of the coal image to obtain a noise feature sequence, and to perform reverse noise reduction processing on the noise feature sequence to obtain the rock inclusion indication feature, wherein the rock inclusion indication feature represents the distribution information of rock inclusion in the original coal image; in one embodiment, the noise processing module 420 can be used to perform the operation S220 described above, which will not be repeated here.

[0127] The coal inclusion recognition module 430 is used to perform multi-resolution encoding and decoding processing on the original coal image to obtain multi-level encoded features and multi-level decoded features. During the skip connection process between the multi-level encoded features and multi-level decoded features, the coal inclusion hint features are fused with the multi-level encoded features and multi-level decoded features using a cross-attention mechanism to obtain a coal inclusion semantic segmentation map representing the coal inclusion recognition result. In one embodiment, the coal inclusion recognition module 430 can be used to perform the operation S230 described above, which will not be repeated here.

[0128] According to embodiments of this application, any plurality of modules among the latent feature extraction module 410, noise processing module 420, and debris inclusion identification module 430 may be combined into one module, or any one of these modules may be split into multiple modules. Alternatively, at least part of the functionality of one or more of these modules may be combined with at least part of the functionality of other modules and implemented in one module. According to embodiments of this application, at least one of the latent feature extraction module 410, noise processing module 420, and debris inclusion identification module 430 may be at least partially implemented as hardware circuitry, such as a field-programmable gate array (FPGA), a programmable logic array (PLA), a system-on-a-chip, a system-on-a-substrate, a system-on-package, an application-specific integrated circuit (ASIC), or any other reasonable means of integrating or packaging the circuitry, or implemented in software, hardware, or firmware, or in any one of the three implementation methods or a suitable combination of any of them. Alternatively, at least one of the latent feature extraction module 410, noise processing module 420, and interstitial coal identification module 430 may be at least partially implemented as a computer program module, which can perform corresponding functions when the computer program module is run.

[0129] Figure 5 A block diagram of an electronic device suitable for implementing a coal interbedded gangue identification method according to an embodiment of this application is shown.

[0130] like Figure 5As shown, an electronic device 500 according to an embodiment of this application includes a processor 501, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 502 or a program loaded from a storage portion 508 into a random access memory (RAM) 503. The processor 501 may include, for example, a general-purpose microprocessor (e.g., a CPU), an instruction set processor and / or an associated chipset and / or a special-purpose microprocessor (e.g., an application-specific integrated circuit (ASIC)), etc. The processor 501 may also include onboard memory for caching purposes. The processor 501 may include a single processing unit or multiple processing units for performing different actions of the method flow according to an embodiment of this application.

[0131] RAM 503 stores various programs and data required for the operation of electronic device 500. Processor 501, ROM 502, and RAM 503 are interconnected via bus 504. Processor 501 executes various operations of the method flow according to embodiments of this application by executing programs in ROM 502 and / or RAM 503. It should be noted that the programs may also be stored in one or more memories other than ROM 502 and RAM 503. Processor 501 may also execute various operations of the method flow according to embodiments of this application by executing programs stored in said one or more memories.

[0132] According to embodiments of this application, the electronic device 500 may further include an input / output (I / O) interface 505, which is also connected to a bus 504. The electronic device 500 may also include one or more of the following components connected to the input / output (I / O) interface 505: an input section 506 including a keyboard, mouse, etc.; an output section 507 including a cathode ray tube (CRT), liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 508 including a hard disk, etc.; and a communication section 509 including a network interface card such as a LAN card, modem, etc. The communication section 509 performs communication processing via a network such as the Internet. A drive 510 is also connected to the input / output (I / O) interface 505 as needed. A removable medium 511, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., is installed on the drive 510 as needed so that computer programs read from it can be installed into the storage section 508 as needed.

[0133] This application also provides a computer-readable storage medium, which may be included in the device / apparatus / system described in the above embodiments; or it may exist independently and not assembled into the device / apparatus / system. The computer-readable storage medium carries one or more programs, which, when executed, implement the method according to the embodiments of this application.

[0134] According to embodiments of this application, the computer-readable storage medium can be a non-volatile computer-readable storage medium, such as including but not limited to: portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof. In this application, the computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. For example, according to embodiments of this application, the computer-readable storage medium may include ROM 502 and / or RAM 503 and / or one or more memories other than ROM 502 and RAM 503 described above.

[0135] Embodiments of this application also include a computer program product comprising a computer program containing program code for performing the methods shown in the flowchart. When the computer program product is run on a computer system, the program code is used to cause the computer system to implement the methods provided in the embodiments of this application.

[0136] When the computer program is executed by the processor 501, it performs the functions defined in the system / apparatus of this application embodiment. According to the embodiments of this application, the systems, apparatuses, modules, units, etc., described above can be implemented by computer program modules.

[0137] In one embodiment, the computer program may rely on a tangible storage medium such as an optical storage device or a magnetic storage device. In another embodiment, the computer program may also be transmitted and distributed in the form of signals over a network medium, and may be downloaded and installed via the communication section 509, and / or installed from a removable medium 511. The program code contained in the computer program can be transmitted using any suitable network medium, including but not limited to: wireless, wired, etc., or any suitable combination thereof.

[0138] In such an embodiment, the computer program can be downloaded and installed from a network via communication section 509, and / or installed from removable medium 511. When the computer program is executed by processor 501, it performs the functions defined in the system of this application embodiment. According to embodiments of this application, the systems, devices, apparatuses, modules, units, etc., described above can be implemented by computer program modules.

[0139] According to embodiments of this application, program code for executing the computer programs provided in the embodiments of this application can be written in any combination of one or more programming languages. Specifically, these computational programs can be implemented using high-level procedural and / or object-oriented programming languages, and / or assembly / machine languages. Programming languages ​​include, but are not limited to, languages ​​such as Java, C++, Python, "C", or similar programming languages. The program code can be executed entirely on the user's computing device, partially on the user's device, partially on a remote computing device, or entirely on a remote computing device or server. In cases involving remote computing devices, the remote computing device can be connected to the user's computing device via any type of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computing device (e.g., via the Internet using an Internet service provider).

[0140] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram or flowchart, and combinations of blocks in a block diagram or flowchart, may be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.

[0141] Those skilled in the art will understand that the features described in the various embodiments of this application can be combined and / or combined in various ways, even if such combinations or combinations are not explicitly described in this application. In particular, the features described in the various embodiments of this application can be combined and / or combined in various ways without departing from the spirit and teachings of this application. All such combinations and / or combinations fall within the scope of this application.

[0142] The embodiments of this application have been described above. However, these embodiments are merely illustrative and not intended to limit the scope of this application. Although various embodiments have been described above, this does not mean that the measures in the various embodiments cannot be used advantageously in combination. Without departing from the scope of this application, those skilled in the art can make various substitutions and modifications, all of which should fall within the scope of this application.

Claims

1. A method for identifying coal containing gangue, characterized in that, The method includes: Feature extraction processing is performed on the original coal image to obtain initial coal image features, wherein the initial coal image features are used to mark the coal region and the interbedded rock region in the original coal image; The initial features of the coal image are subjected to forward noise addition processing to obtain a noise feature sequence, and the noise feature sequence is subjected to reverse noise reduction processing to obtain a rock inclusion indication feature, wherein the rock inclusion indication feature represents the distribution information of rock inclusions in the original coal image; The original coal image is subjected to multi-resolution encoding and decoding processing to obtain multi-level encoding features and multi-level decoding features. During the process of skip connection between the multi-level encoding features and the multi-level decoding features, the coal inclusion prompt features are fused with the multi-level encoding features and the multi-level decoding features in a cross-attention mechanism to obtain a coal inclusion semantic segmentation map representing the coal inclusion recognition result.

2. The method according to claim 1, characterized in that, Feature extraction processing is performed on the original coal image to obtain the initial features of the coal image, including: The original coal image is processed by multiple rounds of residual convolution using the multi-level residual module of the trained latent encoder to obtain multi-level residual convolution features. The stride convolution module of the trained latent encoder is used to perform dimensionality reduction on the multi-level residual convolution features by stride convolution operation to obtain the dimensionality-reduced multi-level residual convolution features. The nonlinear transformation module of the trained latent encoder is used to flatten the multi-level residual convolutional features after dimensionality reduction through a nonlinear transformation operation to obtain the flattened features. The flattened features are compressed using a multi-level fully connected layer of the trained latent encoder to obtain the initial features of the coal image.

3. The method according to claim 1, characterized in that, The initial features of the coal image are subjected to forward noise addition processing to obtain a noise feature sequence including: The Gaussian noise addition module of the trained diffusion model is used to iteratively perform a Gaussian distribution-based noise addition operation on the initial features of the coal image. During the Gaussian distribution-based noise addition operation, the noise variance control parameter is randomly adjusted until a preset iteration number threshold is met, thereby obtaining the noise feature sequence; or The initial features of the coal image are reparameterized using the reparameterization module of the trained diffusion model to obtain the noise feature sequence.

4. The method according to claim 3, characterized in that, The noise feature sequence is subjected to reverse denoising processing to obtain the interstitial rock indication features, including: A noise posterior distribution is constructed based on the noise feature sequence and the initial features of the coal image, wherein the noise posterior distribution is used to represent the distribution probability of the coal inclusions in the original coal image; Based on the noise posterior distribution, the noise-feature mapping relationship between the noise feature sequence and the initial features of the coal image is extracted using the mapping relationship extraction module of the trained diffusion model; Based on the noise-feature mapping relationship, the noise in the noise sequence features is estimated using the noise estimation module of the trained diffusion model to obtain the estimated noise. The encoding auxiliary module of the trained diffusion model is used to generate candidate features for interbedded rock, wherein the candidate features for interbedded rock represent the edge information and texture information of the interbedded rock region; Based on the estimated noise and the candidate features of interstitial rocks, the noise feature sequence is reversed using the denoising module of the trained diffusion model to obtain the interstitial rock inclusion prompt features.

5. The method according to claim 1, characterized in that, The original coal image is subjected to multi-resolution encoding and decoding processing to obtain multi-level encoded features and multi-level decoded features, including: The feature extraction module of the trained Transformer model is used to extract features from the original coal image to obtain a feature embedding vector, which represents the gray-level gradient information, edge information and texture structure information of the original coal image. The multi-level encoder of the trained Transformer model is used to perform a downsampling operation on the feature embedding vector with progressively decreasing spatial resolution to obtain the multi-level encoded features. The multi-level decoder of the trained Transformer model is used to perform upsampling operations on the multi-level encoded features, with the spatial resolution increasing layer by layer, to obtain the multi-level decoded features.

6. The method according to claim 5, characterized in that, During the skip connection process of the multi-level encoded features and the multi-level decoded features, the grit-clamping prompt features are fused with the multi-level encoded features and the multi-level decoded features using a cross-attention mechanism to obtain a grit-clamping semantic segmentation map representing the grit-clamping identification result, including: The multi-level encoded features and the multi-level decoded features are subjected to the same resolution level of skip connection operation using the skip connection module of the trained Transformer model to obtain multi-level intermediate features. The fusion module of the trained Transformer model is used to project the corner cue features to obtain the key vector and value vector for the cross attention mechanism. During the skip connection process, the multi-level intermediate features are linearly transformed using the fusion module of the trained Transformer model to obtain a multi-level query vector for the cross-attention mechanism. During the skip connection process, the fusion module is used to segment the multi-level query vector, key vector and value vector into multiple attention heads, and the multiple attention heads are cross-fused to obtain the jagged semantic segmentation map.

7. A training method for a coal intermingling identification model, wherein the coal intermingling identification model includes a latent encoder, a diffusion model, and a Transformer model, characterized in that, The method includes: The latent encoder is used to extract first image features from coal image samples to mark coal areas and interbedded areas; The coal image samples and the first image features are fused using a cross-attention mechanism using the Transformer model to obtain a coal-intercalated semantic segmentation sample image. The first average absolute error loss function is used to process the rock inclusion segmentation labels of the rock inclusion semantic segmentation sample image and the coal image sample to obtain the first loss value; The parameters of the latent encoder and the Transformer model are optimized using the first loss value to obtain the parameter-optimized latent encoder and the parameter-optimized Transformer model. The process iteratively performs feature extraction, fusion, first loss value acquisition, and parameter optimization until the first preset training condition is met, resulting in a trained latent encoder and a trained Transformer model.

8. The method according to claim 7, characterized in that, Also includes: The diffusion model is used to process the noise in the first image features extracted from the latent encoding completed by the training, so as to obtain the second image features of the coal image sample containing the distribution information of interbedded gangue. The second image features and the coal image sample's interstitial label are processed using the second mean absolute error loss function to obtain the second loss value; The second loss value is used to perform a dynamic parameter optimization operation based on singular value decomposition on the diffusion model to obtain an optimized diffusion model; The noise processing operation, the second loss value acquisition operation, and the parameter dynamic optimization operation based on singular value decomposition are performed iteratively until the second preset training condition is met, so as to obtain the trained diffusion model and thus complete the training of the coal interbedded gangue model. The trained coal interbedded gangue identification model is applied to the method described in any one of claims 2 to 6.

9. The method according to claim 8, characterized in that, Using the second loss value, a dynamic parameter optimization operation based on singular value decomposition is performed on the diffusion model to obtain the optimized diffusion model, which includes: Perform a singular value-based decomposition operation on the multidimensional weight matrix of the diffusion model to obtain a singular value diagonal matrix. The sensitivity coefficient of each singular value in the singular value diagonal matrix is ​​calculated using the second loss value; The sensitivity coefficients of all the singular values ​​are calculated to obtain the dynamic threshold; If the sensitivity coefficient of the singular value is greater than the dynamic threshold, perform parameter optimization operation based on gradient update and regularization constraint on the diffusion model to obtain the optimized diffusion model. When the sensitivity coefficient of the singular value is less than or equal to the dynamic threshold, a parameter decay operation is performed on the diffusion model to obtain the optimized diffusion model.

10. A coal interbedded with gangue identification device, characterized in that, The device includes: A latent feature extraction module is used to perform feature extraction processing on the original coal image to obtain initial features of the coal image, wherein the initial features of the coal image are used to mark the coal region and the interbedded rock region in the original coal image; The noise processing module is used to perform forward noise addition processing on the initial features of the coal image to obtain a noise feature sequence, and to perform reverse noise removal processing on the noise feature sequence to obtain a rock inclusion indication feature, wherein the rock inclusion indication feature represents the distribution information of rock inclusions in the original coal image; The coal inclusion recognition module is used to perform multi-resolution encoding and decoding processing on the original coal image to obtain multi-level encoding features and multi-level decoding features. During the process of skip connection between the multi-level encoding features and the multi-level decoding features, the coal inclusion prompt features are fused with the multi-level encoding features and the multi-level decoding features in a cross-attention mechanism to obtain a coal inclusion semantic segmentation map representing the coal inclusion recognition result.