Soil microorganism classification method based on deep learning

Through deep learning, combined with high-throughput amplicon sequencing and microscopic image data, an integrated soil microbial classification model is constructed, which solves the problems of identification errors and data deviations in the existing technology, and achieves more efficient and accurate soil microbial classification, improving The intelligence and scientificity of detection.

CN119251836APending Publication Date: 2025-01-03HEILONGJIANG OSWO NEW MATERIAL TECH CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411631997.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-15
Publication Date
2025-01-03

AI Technical Summary

Technical Problem

Existing soil microbial classification methods have identification errors and data deviations when processing complex samples. In particular, high-throughput amplicon sequencing is difficult to distinguish very similar microbial species. Microscopic image classification methods rely on high-quality image data and The recognition of diverse microbial morphology is limited.

Method used

Using deep learning-based soil microbial classification method, combining high-throughput amplicon sequencing data and micro image data, an integrated classification model is constructed through feature extraction module and multimodal feature alignment learning strategy, using transformer network and self-attention The force mechanism extracts image features and integrates sequencing and image data through the co-attention fusion module to improve classification accuracy.

Benefits of technology

It significantly improves the accuracy and robustness of soil microbial classification, can automatically identify complex microbial communities, enhances the ability to judge soil health status, and improves the intelligence and scientificity of detection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119251836A_ABST
    Figure CN119251836A_ABST
Patent Text Reader

Abstract

The invention provides a multi-modal soil microorganism classification method based on deep learning. The method comprises the following steps of: cleaning and formatting two types of modal data by using a data preprocessing technology to ensure the quality and consistency of the data, then constructing an efficient feature extraction module, respectively performing feature extraction on the image and amplicon sequencing data in combination with a Transform network and a self-normalization network (SNN) suitable for the sequencing data, and then performing feature extraction on the image and the amplicon sequencing data to obtain a feature extraction result; according to the method, a common attention fusion module is introduced to effectively integrate image features and gene sequence features and capture correlation among different modals, in addition, a multi-modal feature alignment strategy is adopted, feature representation is optimized through a contrast learning method, and therefore the recognition capacity of the model for microbial species is enhanced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of multimodal deep learning, and in particular relates to a soil microorganism classification method based on deep learning. Background Art

[0002] Soil microbial classification is a key technology to promote progress in many fields such as sustainable agricultural development, ecological environmental protection and resource management. In the agricultural field, soil microbial classification has become an important means to monitor soil health, increase crop yields and maintain soil biodiversity by accurately identifying microbial populations and their distribution in the soil. It is of great significance to ensure the stability of agricultural ecosystems. In terms of environmental protection, soil microbial classification can effectively assess the degree of soil pollution, detect and treat harmful components in the soil, and help environmental restoration and resource reuse. In addition, soil microbial classification also has multiple functions such as soil quality rating and pathogen detection, providing efficient and reliable technical support for soil management. However, due to the complexity and diversity of microbial populations in soil samples, the similarities between different populations may lead to classification difficulties. If the soil microbial species cannot be accurately identified, it will affect the accuracy of soil health assessment and restrict the advancement of agricultural and environmental protection work. Therefore, improving the accuracy of soil microbial classification is crucial to enhancing the scientific nature of soil management and resource assessment.

[0003] Existing soil microbial classification methods mainly include the following two methods: high-throughput amplicon sequencing based on genome sequencing and microscopic image classification based on image analysis.

[0004] High-throughput amplicon sequencing:

[0005] This method collects microbial DNA from the soil and uses PCR technology to amplify and sequence specific marker genes (such as 16SrRNA genes). After sequencing, the obtained data is processed by bioinformatics analysis software to extract specific microbial feature information. These microbial features are further classified using machine learning models (such as random forests and support vector machines). This method achieves high-precision identification of a large number of microbial species in a high-throughput and low-cost manner. However, due to the high dependence of amplicon sequencing on small data sets, it is difficult to distinguish very similar microbial species, so there may be identification errors when detecting microbial communities in some complex samples. In addition, the sequencing process is affected by the length and richness of the gene fragments, which may lead to data bias and thus affect the classification accuracy.

[0006] Microscopic image classification method:

[0007] This method uses a high-resolution microscope to collect morphological images of soil microorganisms and classifies them in combination with image analysis algorithms. Through the automatic recognition of the structure, morphology and color characteristics of microbial images, the microscopic image classification method can provide direct information on the distribution of microbial populations. In recent years, the successful application of convolutional neural networks (CNN) in image classification has made image-based soil microbial classification methods gradually popular. The main advantage of this method is that it realizes efficient automated analysis without the need for complex gene amplification processes. However, the microscopic image classification method relies on high-quality image data and has high requirements for hardware equipment (such as microscope resolution, image collector, etc.), so in practical applications, image quality may affect the classification effect. In addition, the microscopic image classification method still has limitations when dealing with diverse microbial morphologies, such as the small morphological differences of some microorganisms, which may lead to misclassification. Therefore, the present invention constructs a soil microbial classification method based on deep learning, which combines gene sequence information and microscopic image features, and implements a classification model based on multimodal deep learning to combine image and sequence knowledge. Summary of the invention

[0008] The present invention proposes a soil microorganism classification method based on deep learning, which solves the problems in the prior art.

[0009] The technical solution of the present invention is implemented as follows: a soil microorganism classification method based on deep learning, characterized in that it includes the following steps:

[0010] The steps include:

[0011] S1: Initial dataset construction: soil samples were collected, high-throughput amplicon sequencing data and high-resolution microscopic image data were extracted, and the initial dataset was constructed. In the data preprocessing stage, operational classification units were applied to the sequencing data for preliminary classification, and then more detailed feature extraction was performed using precise sequence variants.

[0012] S2: Feature extraction module construction: The feature extraction module consists of a sequencing encoding module and an image encoding module. In the image encoding process, the image is first processed in blocks, and then the transformer network is used for feature extraction to fully capture the global and local features of the image. Through the separate feature extraction frameworks, the recognition efficiency of soil microbial features is significantly improved, ensuring that the model can effectively process complex soil samples.

[0013] S3: Construction of soil microbial classification prediction model: By integrating the feature standardized classification model to improve the classification accuracy, in the feature standardization step, all extracted features are normalized to eliminate the dimensional differences between different features. At the same time, a co-attention fusion module is added to effectively combine the features of sequencing data and image data, and finally form a soil microbial classification prediction module;

[0014] S4: Multimodal feature alignment learning strategy: A multimodal feature alignment learning strategy is proposed, which includes a feature mapping module, a positive and negative sample pair construction module, and a feature contrast learning module. The feature mapping module aims to map two types of data into the same feature space. Based on the construction of positive and negative sample pairs, in the feature contrast learning module, the generalization ability and classification accuracy of the model are improved by aligning and distinguishing the features of the two modalities.

[0015] S5: Actual deployment and use of the model: During the process of soil microbial collection and classification model verification, the model was applied to classify and predict the actual collected soil samples to verify the adaptability and accuracy of the model under different soil environments.

[0016] As a preferred embodiment, the initial data set construction comprises the following steps:

[0017] S11 Soil sample collection: Through field investigation of the soil layers to be studied, soil samples are obtained using sampling equipment and related technologies for subsequent extraction and separation of soil data. Soil samples are collected at different sampling locations, and high-throughput amplicon sequencing data and high-resolution microscopic image data are extracted to form a preliminary data set;

[0018] S12 Data preprocessing: In the process of soil sample data extraction, due to differences in sample processing and sequencing technology, there is a small amount of noise and incomplete data. By constructing a data preprocessing module, the extracted soil microbial sequencing data G is preliminarily classified using operational classification units, which are defined as formula (1):

[0019] OTU(G) = {g i |g i ∈G,d(g i , g j )<∈}#(1);

[0020] Where G represents the original sequencing data, g i and g j represents the sample sequence, ∈ is the distance threshold, and the processed sequencing data is obtained, which is also represented by G. The soil image data is obtained by scanning under a microscope. All scanned images are uniformly cropped and constructed into image data I with a uniform resolution size;

[0021] S13 sequencing data pre-grouping: After preliminary classification, in order to obtain more detailed feature information, the exact sequence variant (ASV) method is used for further feature extraction. This method can effectively identify and quantify the microbial features in the sample. This process can be expressed as formula (2):

[0022]

[0023] Among them, F represents the feature set, P(f|g i ) Feature f in sample g i The probability of occurrence in the result is obtained, and the sequencing data after feature extraction is obtained, which is also represented by G;

[0024] S14 Data calibration: Based on the standardized feature data, use annotation tools to calibrate the microbial features and record the location information and related attributes of each feature. This process will provide accurate label data for subsequent model training.

[0025] As a preferred implementation, the feature extraction module construction process includes:

[0026] The constructed feature extraction module includes a multi-depth feature extraction unit and a multi-depth feature fusion unit. The multi-depth feature extraction unit is mainly composed of a sequencing encoding module and an image encoding module. In the image encoding process, the image is firstly processed into blocks to divide the entire image into multiple small blocks, and the position encoding is performed according to the position of each small block. Then, the transformer network is used to extract features from each small block. This method can effectively capture the global and local features of the image through the self-attention mechanism, thereby improving the recognition efficiency of soil microbial features and ensuring that the model can handle complex soil samples.

[0027] By extracting independent features from each modality, the model can be guaranteed to perform decoupled analysis and exploration in high-channel amplicon sequencing data and microbial image data to protect the unique feature advantages of the modality;

[0028] The following steps are involved:

[0029] S21 sequencing data encoding module: The constructed sequencing data encoding module uses a self-normalizing network as an encoder to efficiently encode the input sequencing data. The soil microbial high-channel amplicon sequencing data preprocessed by S1 is G. The data contains a total of 6 groups, each of which corresponds to a representative microbial community feature. Before entering the encoding module, it first passes through a standardization layer to ensure the uniformity and stability of the data. The standardization operation can be expressed as formula (3):

[0030]

[0031] Among them, G inputrepresents the standardized feature set, mean(G) and σ(G) represent the mean and standard deviation of the feature value respectively. The introduction of standardization can effectively reduce the deviation of the data and improve the convergence speed of the subsequent model, thereby enhancing the model's adaptability to the input data. Next, in the encoding module, three identical encoding blocks are designed, and the structure of each block is: input data G input After a fully connected layer, the nonlinear transformation is performed through the SELU activation function. The use of the SELU activation function can automatically adjust the mean and variance of the output, so that the output of each layer remains in a relatively stable range, thereby facilitating the training process of the deep learning model. Subsequently, the input passes through the Alpha Dropout layer, and the final output is formula (4):

[0032] G feature = Dropout(SELU(G input ), p)#(4);

[0033] Where p is the dropout rate. The introduction of Alpha Dropout can not only prevent the model from overfitting, but also maintain the self-normalization characteristics of the data, thereby improving the generalization ability of the model on new samples. For each sequencing group, a self-normalization network is provided for encoding, which can fully explore the feature differences between different groups and effectively improve the accuracy and flexibility of encoding.

[0034] S22 Image data encoding module: The constructed image data encoding module is used to effectively extract features from images of soil microorganisms. First, microbial images I in soil samples are collected through a high-resolution microscope. These images provide rich details and structural information of soil microorganisms. The module first divides the input soil microorganism image into six image blocks evenly according to length and width to support the input characteristics of the subsequent encoder and prompt the encoder to fully capture the details of different areas. The images after block division are set as I1-I6. The block processing helps to capture the spatial distribution characteristics of different microorganisms in the image and enhances the comprehensiveness of feature extraction. Subsequently, the linear projection method is used to process each block to map high-dimensional features to low-dimensional space. The formula is expressed as formula (5):

[0035]

[0036] in, is the projection result of the jth image block, w j and b j are weight matrix and bias respectively. Then, the block features are weighted through the self-attention layer so that the model can focus on the important areas in the image. The formula is expressed as formula (6):

[0037]

[0038] Among them, Q, K, and V represent query, key, and value respectively. k As the key dimension, the self-attention mechanism further enhances the model's ability to capture important features by calculating the relationship between blocks;

[0039] Next, after further processing by the feedforward layer, the image feature I is finally obtained. feature , which contains six eigenvectors, among which the feedforward neural network not only improves the recognition accuracy of the model for soil microbial images, but also enhances the ability to capture microbial characteristics, ensuring the robustness of the model under different sample conditions.

[0040] As a preferred embodiment, the construction process of the soil microorganism classification prediction model includes:

[0041] In the soil microbial classification prediction model, the integrated feature normalization, co-attention fusion and residual splicing methods are mainly used to improve the classification accuracy. First, the extracted features are processed by feature normalization to eliminate the dimensional differences between different features. The feature normalization step combines batch normalization layer and layer normalization to ensure that the model can effectively cope with feature changes in both training and inference stages. Subsequently, the co-attention fusion module is introduced to convert the sequencing feature G feature and image feature I feature Effective combination,This module adopts the cross attention mechanism, which generates attention values ​​by interacting the queries (q), keys (k) and values ​​(v) of the two modalities, and then realizes the fusion of different modal information. This process not only enhances the expression ability of features, but also improves the model's ability to distinguish soil microorganism classification tasks. Finally, after processing by the microbial classification layer, the model outputs the final classification prediction results;

[0042] The specific steps include:

[0043] S31 Feature Standardization Module: In the constructed feature standardization module, different standardization methods are used for sequencing features and image features. In deep learning, standardization is an important preprocessing step to ensure that the input data is distributed within an appropriate range, which helps to avoid network instability caused by the increase in the number of layers. By pulling the data back to the standard normal distribution, the stability of training can be improved, the model can be converged faster, and the final performance can be improved. For sequencing features, the layer normalization method is used because its feature dimension is relatively small and the feature distribution of each sample varies greatly, so G can be obtained. fusion =LN(G feature ), relatively speaking, for image features, batch normalization method is used, thus obtaining I fusion =BN(I feature), BN effectively reduces the internal covariate shift by standardizing the features in each training batch, so that the model can converge faster during the training process. BN is particularly suitable for processing image data because it can improve the robustness of the model in image scanning differences or image quality differences through normalization;

[0044] S32 Co-attention fusion module: The co-attention fusion module constructed in this paper aims to effectively integrate sequencing features and image features to improve the accuracy of soil microbial classification. According to the paradigm of the attention mechanism, this module first extracts the sequencing features G fusion and image feature I fusion The query (q), key (k) and value (v) of G , K G , V G , the image feature is represented by Q I , K I , V I , Next, the attention weight between the sequencing features and the image features is calculated through the cross attention mechanism as shown in formula (7):

[0045]

[0046] Among them A G→I It represents the part of the image feature that is similar to its contribution, guided by the sequencing feature. The weight is applied to the value of the image feature, and the fused feature is expressed as Similarly, the attention weight of the image feature to the sequencing feature is calculated as formula (8):

[0047]

[0048] And applied to the value of the sequencing feature, another fused feature is obtained through residual connection and represented as Finally, the two fused features F G and F I Integration provides more comprehensive information for subsequent classification prediction. By focusing on the relationship between different modes, the fusion process effectively enhances the model's ability to distinguish soil microbial classification.

[0049] S33 Microbial prediction module: After feature fusion, the constructed microbial prediction module first processes the features of each modality through two multi-head self-attention modules to deeply explore the knowledge related to the characteristics of soil microbial communities. After the self-attention module, the sequencing feature F′ can be obtained. G and image feature F′ I After feature concatenation, the final prediction feature for soil microbial classification can be obtained as shown in formula (9):

[0050] Output = Concat(F′ G , F′ I )#(9);

[0051] Finally, the concatenated features will be input into a multi-layer perceptron, which consists of several fully connected layers to further refine the feature information and increase the expressive power of the model. After being processed by the activation function, they are finally classified and output through the Softmax layer to generate the predicted probability of each type of soil microorganism. This structure can effectively integrate information from different modalities.

[0052] As a preferred implementation, the learning strategy process of the multimodal feature alignment includes:

[0053] In the learning strategy of multimodal feature alignment, the main method used is to construct positive and negative sample pairs to achieve feature alignment under contrastive learning. This part is performed before multimodal fusion. This is because the features of different modalities belong to different modal feature distribution spaces before fusion, making it difficult for the model to model the interaction relationship between different modalities, further reducing the reliability of multimodal fusion. Therefore, the extracted sequencing feature G is first feature and image feature I feature Corresponding feature mapping is performed to map the features of the two modalities to the same feature space, and then feature alignment is performed. Next, positive and negative sample pairs that support contrastive learning are constructed. According to the category of each soil microorganism, different modal features of the same category are used as positive sample pairs, and modal features of other categories different from the category are used as negative sample pairs. Finally, the contrastive learning strategy is used to constrain the positive and negative sample pairs. Specifically, the cosine similarity of the positive sample pairs is pulled in through the loss function, and at the same time, the Euclidean distance between the negative sample pairs is pushed away to achieve the alignment of modal features of the same category. Through the above method, the soil microorganism classification prediction model performs effective feature alignment before fusion, which promotes the model to learn multimodal fusion knowledge;

[0054] The specific steps include:

[0055] S41 Sequencing Feature Mapping Module: In the multimodal feature alignment module, in order to realize the sequencing feature G feature and image feature I feature To effectively integrate the two modalities, we first need to map them to the same feature space. To this end, we design two independent mapping networks to process sequencing data and image data respectively. featureThe mapping network consists of three fully connected layers: the first layer has 128 nodes, the second layer has 64 nodes, and the third layer has 32 nodes. ReLU activation function is used between each layer. In order to stabilize the data distribution, a Batch Normalization layer is added between the second and third layers. The output after the network mapping is G contrast , which is projected into a 32-dimensional unified feature space. For the image feature I feature The mapping network structure is similar to the sequencing feature mapping network, and also contains three fully connected layers. The first layer has 128 nodes, the second layer has 64 nodes, and the third layer has 32 nodes. The network also uses BN for normalization between the second and third layers, and adds ReLU activation to each layer to enhance the nonlinear expression ability of the model; the output of the image feature map is I contrast , also in the 32-dimensional feature space;

[0056] Through the above structure, the sequencing features and image features are mapped to the same feature space, which facilitates the interaction between modalities in the subsequent contrastive learning and feature alignment process;

[0057] S42 positive and negative sample pair construction module: In the positive and negative sample pair construction module, a positive and negative sample pair construction method based on the mapping features of S41 is designed to achieve effective alignment and classification prediction of multimodal features. This module generates positive and negative sample pairs for each soil microbial category and further aligns the two modal features to promote consistency between multimodal features.

[0058] First, the construction of positive sample pairs is based on the principle of the same category; it is assumed that the collected samples contain a total of N categories, and for one of the categories C i , i∈{1, 2, ..., N} soil microorganisms, in each training batch, the sequencing features G from this category contrast and image feature I contrast As a positive sample pair, the positive sample pair reduces the distance between the two modal features through the shared feature space expression, thereby achieving alignment on similar semantics. Then, the construction of the negative sample pair is based on the principle of different categories. For the target category C i The corresponding sequencing feature G contrast , image features of other categories I contrast Both are regarded as negative samples, and vice versa. This strategy forms a clear category boundary in the feature space by increasing the Euclidean distance between negative sample pairs, thus avoiding the overlap of features of different categories.

[0059] S43 feature contrast learning module: In the feature contrast learning module, a contrast loss function based on InfoNCE is used to achieve effective alignment of features of different modalities. This loss function brings the positive and negative sample pairs of different modalities constructed based on S42 closer, thereby shortening the distance between features of the same category in the feature space, and then unifying the expression of the feature space before multimodal fusion;

[0060] For each soil microbial sample pair, we will use the sequencing features G of the same category of the positive sample pair contrast and image feature I contrast The similarity is maximized, while the sequencing and image features of negative samples for different categories are minimized. Specifically, the InfoNCE loss function can be defined as formula (10):

[0061]

[0062] Where N is the number of categories contained in each batch, sim(·,·) represents the cosine similarity of the features, and T is the temperature parameter used to control the smoothness of the distribution. By maximizing the similarity of features of the same category and pushing features of different categories away in the feature space, this module can align sequencing features and image features, providing more discriminative feature representations for subsequent soil microbial classification tasks.

[0063] As a preferred embodiment, the method for implementing soil microorganism classification includes:

[0064] Based on the soil microbial classification prediction model designed in S3 and combined with the feature alignment learning strategy described in S4, an optimized soil microbial classification model is finally obtained. This optimized model is applied to soil sample analysis to achieve intelligent classification of soil microorganisms.

[0065] The specific steps include:

[0066] S51 Soil sample collection: By collecting soil samples from multiple locations, we can obtain rich sample materials and provide continuous and analyzable basic data for the verification and deployment of the post-model;

[0067] S52 Sample data separation and extraction: Separate and extract the collected soil samples, and save them in groups in accordance with the model input paradigm to ensure that different types of samples can be processed independently for subsequent analysis;

[0068] S53 data sub-modal processing: modal processing of the extracted high-throughput amplicon sequencing data and high-resolution microscopic image data, using operational classification units and precise sequence variants to extract sequencing data features, unify the resolution of soil microbial images, and ensure the accuracy and integrity of the data;

[0069] S54 Microbial classification prediction model deployment: Deploy the optimized soil microbial classification prediction model to the analysis system, and send the processed data into the model for classification to obtain the specific distribution and classification results of soil microorganisms;

[0070] S55 Multi-location soil microorganism prediction results: Summarize the soil microorganism classification results of different locations and conduct comparative analysis to reveal the distribution characteristics of regional soil microorganisms;

[0071] S56 Soil Management and Resource Assessment: Based on the microbial classification results output by the model, soil management and resource assessment are carried out to provide data support for agriculture and environmental protection, and to improve soil utilization efficiency and ecological sustainability.

[0072] After adopting the above technical solution, the beneficial effects of the present invention are:

[0073] (1) Improved automation and intelligence: This method can automatically identify complex microbial communities by training a soil microbial classification model based on transformers and self-normalizing networks, thereby significantly improving classification efficiency and accuracy. At the same time, combined with the self-attention mechanism, the microbial characteristics and sequencing data in different soils can be combined to provide a more comprehensive perspective to identify the health status of the soil, thereby improving the intelligence of soil detection.

[0074] (2) Improve the model's understanding of shared information: By introducing a contrastive learning strategy, the model can effectively align features in different modalities. This method enables the model to not only capture information from a single modality during feature extraction, but also identify and fuse shared information across modalities, thereby improving classification accuracy. Contrastive learning provides rich contextual information, which helps enhance the model's understanding ability, enabling it to more accurately determine the types and characteristics of soil microorganisms, thereby promoting the scientificity and reliability of soil health assessments.

[0075] (3) Improving the accuracy of microbial classification: The present invention enhances the comprehensiveness of feature extraction by effectively combining high-throughput amplicon sequencing data and microscopic image data. In the feature extraction process, the advantages of the transformer network and the self-normalization network are utilized to make the classification of soil microorganisms more accurate, thereby improving the reliability of detection.

[0076] (4) Improve the robustness of classification: Multiple modal data are used in the soil microbial prediction model, so that the model can still maintain excellent discrimination ability when facing the complexity of different soil samples. In addition, the feature fusion strategy based on the co-attention mechanism helps the model explore the interactive consistency information within the modality, and enables practical applications to flexibly respond to the impact of environmental changes (such as soil moisture, light conditions, etc.) on classification results, ensuring the stability of classification results. BRIEF DESCRIPTION OF THE DRAWINGS

[0077] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.

[0078] Figure 1 It is a flow chart of the overall technical route of the present invention;

[0079] Figure 2 This is a schematic diagram of the sequencing data encoding module of the present invention;

[0080] Figure 3 This is a schematic diagram of an image data encoding module of the present invention;

[0081] Figure 4 Schematic diagram of the microbial classification prediction model of the present invention;

[0082] Figure 5 Schematic diagram of a multimodal feature alignment module of the present invention;

[0083] Figure 6 Deploy the actual process for the model of the present invention. DETAILED DESCRIPTION

[0084] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0085] Example 1

[0086] like Figure 1 As shown in the overall technical route flow chart, a soil microorganism classification method based on deep learning is characterized by comprising the following steps:

[0087] S1: Initial dataset construction: Soil samples were collected, and high-throughput amplicon sequencing data and high-resolution microscopic image data were extracted to construct the initial dataset. In the data preprocessing stage, the sequencing data was preliminarily classified using operational taxonomic units (OTUs), and then more detailed feature extraction was performed using accurate sequence variants (ASVs) to ensure the accuracy and completeness of the data. Image data was cropped and the image size was unified to lay the foundation for subsequent analysis and modeling.

[0088] S2: Feature extraction module construction: The feature extraction module consists of a sequencing encoding module (self-normalizing network, SNN) and an image encoding module. In the image encoding process, the image is first processed in blocks, and then the transformer network (Transformer) is used for feature extraction to fully capture the global and local features of the image. Through the separate feature extraction frameworks, the recognition efficiency of soil microbial features is significantly improved, ensuring that the model can effectively process complex soil samples.

[0089] S3: Construction of soil microorganism classification prediction model: By integrating the feature standardized classification model to improve the classification accuracy, in the feature standardization step, all extracted features are normalized to eliminate the dimensional differences between different features. At the same time, a co-attention fusion module is added to effectively combine the features of sequencing data and image data, and finally form a soil microorganism classification prediction module. This combination enhances the model's discrimination ability in classification tasks, thereby improving classification accuracy;

[0090] S4: Multimodal feature alignment learning strategy: A multimodal feature alignment learning strategy is proposed, which includes a feature mapping module, a positive and negative sample pair construction module, and a feature contrast learning module. The feature mapping module aims to map two types of data into the same feature space. Based on the construction of positive and negative sample pairs, in the feature contrast learning module, the generalization ability and classification accuracy of the model are improved by aligning and distinguishing the features of the two modalities, ensuring good recognition performance in a variety of soil samples.

[0091] S5: Actual deployment and use of the model: During the process of soil microbial collection and classification model verification, the model was applied to classify and predict the actual soil samples collected to verify the adaptability and accuracy of the model under different soil environments. Finally, combined with the experimental results, the practical application potential of this method in soil health monitoring and agricultural management was evaluated.

[0092] The initial dataset construction includes the following steps:

[0093] S11 Soil sample collection: Through field investigation of the soil layers to be studied, soil samples are obtained using sampling equipment and related technologies for subsequent extraction and separation of soil data. Soil samples are collected at different sampling locations, and high-throughput amplicon sequencing data and high-resolution microscopic image data are extracted to form a preliminary data set;

[0094] S12 Data preprocessing: In the process of soil sample data extraction, due to differences in sample processing and sequencing technology, there is a small amount of noise and incomplete data, which affects the accuracy of subsequent analysis. By constructing a data preprocessing module, the extracted soil microbial sequencing data G is preliminarily classified using operational classification units, which is defined as formula (1):

[0095] OTU(G) = {g i |g i ∈G,d(g i , g j )<∈}#(1);

[0096] Where G represents the original sequencing data, g i and g j represents the sample sequence, ∈ is the distance threshold, and the processed sequencing data is obtained, which is also represented by G. The soil image data is obtained by scanning under a microscope. All scanned images are uniformly cropped and constructed into image data I with a uniform resolution size;

[0097] S13 Sequencing data pre-grouping: After preliminary classification, in order to obtain more detailed feature information, the precise sequence variant method is used for further feature extraction. This method can effectively identify and quantify the microbial features in the sample and ensure the integrity and accuracy of the data set. This process can be expressed as formula (2):

[0098]

[0099] Among them, F represents the feature set, P(f|g i ) Feature f in sample g i The probability of occurrence in the result is obtained, and the sequencing data after feature extraction is obtained, which is also represented by G;

[0100] S14 Data calibration: Based on the standardized feature data, use annotation tools to calibrate the microbial features and record the location information and related attributes of each feature. This process will provide accurate label data for subsequent model training and ensure the reliability of classification results.

[0101] like Figure 2-3 As shown, the process of constructing the feature extraction module based on the sequencing encoder unit and the image encoder unit includes:

[0102] The constructed feature extraction module includes a multi-depth feature extraction unit and a multi-depth feature fusion unit. The multi-depth feature extraction unit is mainly composed of a sequencing encoding module and an image encoding module. In the image encoding process, the image is firstly processed into blocks to divide the entire image into multiple small blocks, and the position encoding is performed according to the position of each small block. Then, the transformer network is used to extract features from each small block. This method can effectively capture the global and local features of the image through the self-attention mechanism, thereby improving the recognition efficiency of soil microbial features and ensuring that the model can handle complex soil samples.

[0103] By extracting independent features from each modality, the model can be guaranteed to perform decoupled analysis and exploration in high-channel amplicon sequencing data and microbial image data, protecting the unique feature advantages of the modality. In addition, the separate feature encoder can also flexibly adjust the parameters and structure of the model to adapt to different application scenarios. This flexibility not only improves the robustness of the model, but also enhances its adaptability and performance in practical applications.

[0104] The following steps are involved:

[0105] S21 sequencing data encoding module: The constructed sequencing data encoding module uses a self-normalizing network (SNN) as an encoder to efficiently encode the input sequencing data. The soil microbial high-channel amplicon sequencing data preprocessed by S1 is G. The data contains a total of 6 groups, each of which corresponds to a representative microbial community feature. Before entering the encoding module, it first passes through a standardization layer to ensure the uniformity and stability of the data. The standardization operation can be expressed as formula (3):

[0106]

[0107] Among them, G input represents the standardized feature set, mean(G) and σ(G) represent the mean and standard deviation of the feature value respectively. The introduction of standardization can effectively reduce the deviation of the data and improve the convergence speed of the subsequent model, thereby enhancing the model's adaptability to the input data. Next, in the encoding module, three identical encoding blocks are designed, and the structure of each block is: input data G input After a fully connected layer, the nonlinear transformation is performed through the SELU activation function. The use of the SELU activation function can automatically adjust the mean and variance of the output, so that the output of each layer remains in a relatively stable range, thereby facilitating the training process of the deep learning model. Subsequently, the input passes through the A1pha Dropout layer, and the final output is formula (4):

[0108] G feature = Dropout(SELU(G input ), p)#(4);

[0109] Where p is the dropout rate. The introduction of Alpha Dropout can not only prevent the model from overfitting, but also maintain the self-normalization characteristics of the data, thereby improving the generalization ability of the model on new samples. For each sequencing group, a self-normalization network is provided for encoding, which can fully explore the feature differences between different groups and effectively improve the accuracy and flexibility of encoding.

[0110] S22 Image data encoding module: The constructed image data encoding module is used to effectively extract features from images of soil microorganisms. First, microbial images I in soil samples are collected through a high-resolution microscope. These images provide rich details and structural information of soil microorganisms. The module first divides the input soil microorganism image into six image blocks evenly according to length and width to support the input characteristics of the subsequent encoder and prompt the encoder to fully capture the details of different areas. The images after block division are set as I1-I6. The block processing helps to capture the spatial distribution characteristics of different microorganisms in the image and enhances the comprehensiveness of feature extraction. Subsequently, the linear projection method is used to process each block to map high-dimensional features to low-dimensional space. The formula is expressed as formula (5):

[0111]

[0112] in, is the projection result of the jth image block, w j and b j are weight matrix and bias respectively. Then, the block features are weighted through the self-attention layer so that the model can focus on the important areas in the image. The formula is expressed as formula (6):

[0113]

[0114] Among them, Q, K, and V represent query, key, and value respectively. k As the key dimension, the self-attention mechanism further enhances the model's ability to capture important features by calculating the relationship between blocks;

[0115] Next, after further processing by the feedforward layer, the image feature I is finally obtained. feature , which contains six eigenvectors. Among them, the feedforward neural network not only improves the model's recognition accuracy of soil microbial images, but also enhances its ability to capture microbial characteristics, ensuring the robustness of the model under different sample conditions. The overall process is designed to achieve efficient and accurate soil microbial feature extraction, providing a solid foundation for subsequent analysis.

[0116] like Figure 4 As shown in Figure 1, the construction process of the soil microbial classification prediction model includes:

[0117] In the soil microbial classification prediction model, the integrated feature normalization, co-attention fusion and residual splicing methods are mainly used to improve the classification accuracy. First, the extracted features are processed by feature normalization to eliminate the dimensional differences between different features. The feature normalization step combines the batch normalization (BN) layer and the layer normalization (LN) layer to ensure that the model can effectively cope with feature changes in both training and inference stages and improve the stability of the model. Subsequently, the co-attention fusion module is introduced to convert the sequencing feature G feature and image feature I feature Effective combination,This module adopts the cross attention mechanism, which generates attention values ​​by interacting the queries (q), keys (k) and values ​​(v) of the two modalities, and then realizes the fusion of different modal information. This process not only enhances the expression ability of features, but also improves the model's ability to distinguish soil microorganism classification tasks. Finally, after processing by the microbial classification layer, the model outputs the final classification prediction results;

[0118] The specific steps include:

[0119] S31 Feature Standardization Module: In the constructed feature standardization module, different standardization methods are used for sequencing features and image features. In deep learning, standardization is an important preprocessing step to ensure that the input data is distributed within an appropriate range, which helps to avoid network instability caused by the increase in the number of layers. By pulling the data back to the standard normal distribution, the stability of training can be improved, the model can be converged faster, and the final performance can be improved. For sequencing features, the layer normalization (LN) method is used because its feature dimension is relatively small and the feature distribution of each sample varies greatly, so G can be obtained. fusion =LN(G feature ), relatively speaking, for image features, the batch normalization (BN) method is used, thus obtaining I fusion =BN(I feature ), BN effectively reduces the internal covariate shift by standardizing the features in each training batch, so that the model can converge faster during the training process. BN is particularly suitable for processing image data because it can improve the robustness of the model in image scanning differences or image quality differences through normalization;

[0120] S32 Co-attention fusion module: The co-attention fusion module constructed in this paper aims to effectively integrate sequencing features and image features to improve the accuracy of soil microbial classification. According to the paradigm of the attention mechanism, this module first extracts the sequencing features G fusion and image feature I fusion The query (q), key (k) and value (v) of G , K G , V G, the image feature is represented by Q I , K I , V I , Next, the attention weight between the sequencing features and the image features is calculated through the cross attention mechanism as shown in formula (7):

[0121]

[0122] Among them A G→I It represents the part of the image feature that is similar to its contribution, guided by the sequencing feature. The weight is applied to the value of the image feature, and the fused feature is expressed as Similarly, the attention weight of the image feature to the sequencing feature is calculated as formula (8):

[0123]

[0124] And applied to the value of the sequencing feature, another fused feature is obtained through residual connection and represented as Finally, the two fused features F G and F I Integration provides more comprehensive information for subsequent classification prediction. By focusing on the relationship between different modes, the fusion process effectively enhances the model's ability to distinguish soil microbial classification.

[0125] S33 Microbial prediction module: After feature fusion, the constructed microbial prediction module first processes the features of each modality through two multi-head self-attention modules to deeply explore the knowledge related to the characteristics of soil microbial communities. After the self-attention module, the sequencing feature F′ can be obtained. G and image feature F′ I After feature concatenation, the final prediction feature for soil microbial classification can be obtained as shown in formula (9):

[0126] Output = Concat(F′ G , F′ I )#(9);

[0127] Finally, the concatenated features will be input into a multi-layer perceptron (MLP), which consists of several fully connected layers to further refine the feature information and increase the expressive power of the model. After being processed by the activation function, the Softmax layer is used for classification output to generate the prediction probability of each type of soil microorganism. This structure can effectively integrate information from different modalities, improve the accuracy and reliability of classification, and provide a more accurate basis for the classification of soil microorganisms.

[0128] like Figure 5 As shown in Figure 2, the learning strategy process for multimodal feature alignment includes:

[0129] In the learning strategy of multimodal feature alignment, the main method used is to construct positive and negative sample pairs to achieve feature alignment under contrastive learning. This part is performed before multimodal fusion. This is because the features of different modalities belong to different modal feature distribution spaces before fusion, making it difficult for the model to model the interaction relationship between different modalities, further reducing the reliability of multimodal fusion. Therefore, the extracted sequencing feature G is first feature and image feature I feature Corresponding feature mapping is performed to map the features of the two modalities to the same feature space, and then feature alignment is performed. Next, positive and negative sample pairs that support contrastive learning are constructed. According to the category of each soil microorganism, different modal features of the same category are used as positive sample pairs, and modal features of other categories different from the category are used as negative sample pairs. Finally, the contrastive learning strategy is used to constrain the positive and negative sample pairs. Specifically, the cosine similarity of the positive sample pairs is pulled in through the loss function, and at the same time, the Euclidean distance between the negative sample pairs is pushed away to achieve the alignment of modal features of the same category. Through the above method, the soil microorganism classification prediction model performs effective feature alignment before fusion, which promotes the model to learn multimodal fusion knowledge;

[0130] The specific steps include:

[0131] S41 Sequencing Feature Mapping Module: In the multimodal feature alignment module, in order to realize the sequencing feature G feature and image feature I feature To effectively integrate the two modalities, we first need to map them to the same feature space. To this end, we design two independent mapping networks to process sequencing data and image data respectively. feature The mapping network consists of three fully connected layers: the first layer has 128 nodes, the second layer has 64 nodes, and the third layer has 32 nodes. ReLU activation function is used between each layer. In order to stabilize the data distribution, Batch Normalization (BN) layer is added between the second and third layers. The output after the network mapping is G contrast , which is projected into a 32-dimensional unified feature space. For the image feature I feature The mapping network structure is similar to the sequencing feature mapping network, and also contains three fully connected layers. The first layer has 128 nodes, the second layer has 64 nodes, and the third layer has 32 nodes. The network also uses BN for normalization between the second and third layers, and adds ReLU activation to each layer to enhance the nonlinear expression ability of the model; the output of the image feature map is I contrast , also in the 32-dimensional feature space;

[0132] Through the above structure, the sequencing features and image features are mapped to the same feature space, which facilitates the interaction between modalities in the subsequent contrastive learning and feature alignment process;

[0133] S42 positive and negative sample pair construction module: In the positive and negative sample pair construction module, a positive and negative sample pair construction method based on the mapping features of S41 is designed to achieve effective alignment and classification prediction of multimodal features. This module generates positive and negative sample pairs for each soil microbial category and further aligns the two modal features to promote consistency between multimodal features.

[0134] First, the construction of positive sample pairs is based on the principle of the same category; it is assumed that the collected samples contain a total of N categories, and for one of the categories C i , i∈{1, 2, ..., N} soil microorganisms, in each training batch, the sequencing features G from this category contrast and image feature I contrast As a positive sample pair, the positive sample pair reduces the distance between the two modal features through the shared feature space expression, thereby achieving alignment on similar semantics. Then, the construction of the negative sample pair is based on the principle of different categories. For the target category C i The corresponding sequencing feature G contrast , image features of other categories I contrast Both are regarded as negative samples, and vice versa. This strategy forms a clear category boundary in the feature space by increasing the Euclidean distance between negative sample pairs, thus avoiding the overlap of features of different categories.

[0135] S43 feature contrast learning module: In the feature contrast learning module, a contrast loss function based on InfoNCE is used to achieve effective alignment of features of different modalities. This loss function brings the positive and negative sample pairs of different modalities constructed based on S42 closer, thereby shortening the distance between features of the same category in the feature space, and then unifying the expression of the feature space before multimodal fusion;

[0136] For each soil microbial sample pair, we will use the sequencing features G of the same category of the positive sample pair contrast and image feature I contrast The similarity is maximized, while the sequencing and image features of negative samples for different categories are minimized. Specifically, the InfoNCE loss function can be defined as formula (10):

[0137]

[0138] Where N is the number of categories contained in each batch, sim(·,·) represents the cosine similarity of the features, and T is the temperature parameter used to control the smoothness of the distribution. By maximizing the similarity of features of the same category and pushing features of different categories away in the feature space, this module can align sequencing features and image features, providing more discriminative feature representations for subsequent soil microbial classification tasks.

[0139] like Figure 6 As shown, the implementation method of soil microbial classification includes:

[0140] Based on the soil microbial classification prediction model designed in S3 and combined with the feature alignment learning strategy described in S4, an optimized soil microbial classification model is finally obtained. This optimized model is applied to soil sample analysis to achieve intelligent classification of soil microorganisms.

[0141] The specific steps include:

[0142] S51 Soil sample collection: By collecting soil samples from multiple locations, we can obtain rich sample materials and provide continuous and analyzable basic data for the verification and deployment of the post-model;

[0143] S52 Sample data separation and extraction: Separate and extract the collected soil samples, and save them in groups in accordance with the model input paradigm to ensure that different types of samples can be processed independently for subsequent analysis;

[0144] S53 data sub-modal processing: modal processing of the extracted high-throughput amplicon sequencing data and high-resolution microscopic image data, using operational classification units and precise sequence variants to extract sequencing data features, unify the resolution of soil microbial images, and ensure the accuracy and integrity of the data;

[0145] S54 Microbial classification prediction model deployment: Deploy the optimized soil microbial classification prediction model to the analysis system, and send the processed data into the model for classification to obtain the specific distribution and classification results of soil microorganisms;

[0146] S55 Multi-location soil microorganism prediction results: Summarize the soil microorganism classification results of different locations and conduct comparative analysis to reveal the distribution characteristics of regional soil microorganisms;

[0147] S56 Soil Management and Resource Assessment: Based on the microbial classification results output by the model, soil management and resource assessment are carried out to provide data support for agriculture and environmental protection, and to improve soil utilization efficiency and ecological sustainability.

[0148] In the description of the present invention, it should be understood that the terms "longitudinal", "lateral", "upper", "lower", "front", "back", "left", "right", "vertical", "horizontal", "top", "bottom", "inside", "outside" and the like indicate orientations or positional relationships based on the orientations or positional relationships shown in the accompanying drawings, and are only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as a limitation on the present invention. In the description of the present invention, unless otherwise specified and limited, it should be noted that the terms "installed", "connected" and "connected" should be understood in a broad sense, for example, it can be a mechanical connection or an electrical connection, or it can be the internal communication of two elements, it can be a direct connection, or it can be an indirect connection through an intermediate medium. For ordinary technicians in this field, the specific meanings of the above terms can be understood according to specific circumstances.

[0149] The above are only preferred embodiments of the present invention and are not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the protection scope of the present invention.

Claims

1. A soil microorganism classification method based on deep learning, characterized in that: The steps include: S1: Initial dataset construction: soil samples were collected, high-throughput amplicon sequencing data and high-resolution microscopic image data were extracted, and the initial dataset was constructed. In the data preprocessing stage, operational classification units were applied to the sequencing data for preliminary classification, and then more detailed feature extraction was performed using precise sequence variants. S2: Feature extraction module construction: The feature extraction module consists of a sequencing encoding module and an image encoding module. In the image encoding process, the image is first processed in blocks, and then the transformer network is used for feature extraction to fully capture the global and local features of the image. Through the separate feature extraction frameworks, the recognition efficiency of soil microbial features is significantly improved, ensuring that the model can effectively process complex soil samples. S3: Construction of soil microbial classification prediction model: By integrating the feature standardized classification model to improve the classification accuracy, in the feature standardization step, all extracted features are normalized to eliminate the dimensional differences between different features. At the same time, a co-attention fusion module is added to effectively combine the features of sequencing data and image data, and finally form a soil microbial classification prediction module; S4: Multimodal feature alignment learning strategy: A multimodal feature alignment learning strategy is proposed, which includes a feature mapping module, a positive and negative sample pair construction module, and a feature contrast learning module. The feature mapping module aims to map two types of data into the same feature space. Based on the construction of positive and negative sample pairs, in the feature contrast learning module, the generalization ability and classification accuracy of the model are improved by aligning and distinguishing the features of the two modalities. S5: Actual deployment and use of the model: During the process of soil microbial collection and classification model verification, the model was applied to classify and predict the actual collected soil samples to verify the adaptability and accuracy of the model under different soil environments.

2. The soil microorganism classification method based on deep learning according to claim 1, characterized in that: The initial data set construction includes the following steps: S11 Soil sample collection: Through field investigation of the soil layers to be studied, soil samples are obtained using sampling equipment and related technologies for subsequent extraction and separation of soil data. Soil samples are collected at different sampling locations, and high-throughput amplicon sequencing data and high-resolution microscopic image data are extracted to form a preliminary data set; S12 Data preprocessing: In the process of soil sample data extraction, due to differences in sample processing and sequencing technology, there is a small amount of noise and incomplete data. By constructing a data preprocessing module, the extracted soil microbial sequencing data G is preliminarily classified using operational classification units, which are defined as formula (1): OTU(G)={g i |g i ∈G,d(g i ,g j )<∈}#(1); Where G represents the original sequencing data, g i and g j represents the sample sequence, ∈ is the distance threshold, and the processed sequencing data is obtained, which is also represented by G. The soil image data is obtained by scanning under a microscope. All scanned images are uniformly cropped and constructed into image data I with a uniform resolution size; S13 sequencing data pre-grouping: After preliminary classification, in order to obtain more detailed feature information, the exact sequence variant (ASV) method is used for further feature extraction. This method can effectively identify and quantify the microbial features in the sample. This process can be expressed as formula (2): Among them, F represents the feature set, P(f|g i ) Feature f in sample g i The probability of occurrence in the result is obtained, and the sequencing data after feature extraction is obtained, which is also represented by G; S14 Data calibration: Based on the standardized feature data, use annotation tools to calibrate the microbial features and record the location information and related attributes of each feature. This process will provide accurate label data for subsequent model training.

3. The soil microorganism classification method based on deep learning according to claim 1, characterized in that: The feature extraction module construction process includes: The constructed feature extraction module includes a multi-depth feature extraction unit and a multi-depth feature fusion unit. The multi-depth feature extraction unit is mainly composed of a sequencing encoding module and an image encoding module. In the image encoding process, the image is firstly processed into blocks to divide the entire image into multiple small blocks, and the position encoding is performed according to the position of each small block. Then, the transformer network is used to extract features from each small block. This method can effectively capture the global and local features of the image through the self-attention mechanism, thereby improving the recognition efficiency of soil microbial features and ensuring that the model can handle complex soil samples. By extracting independent features from each modality, the model can be guaranteed to perform decoupled analysis and exploration in high-channel amplicon sequencing data and microbial image data to protect the unique feature advantages of the modality; The following steps are involved: S21 sequencing data encoding module: The constructed sequencing data encoding module uses a self-normalizing network as an encoder to efficiently encode the input sequencing data. The soil microbial high-channel amplicon sequencing data preprocessed by S1 is G. The data contains a total of 6 groups, each of which corresponds to a representative microbial community feature. Before entering the encoding module, it first passes through a standardization layer to ensure the uniformity and stability of the data. The standardization operation can be expressed as formula (3): Among them, G input represents the standardized feature set, mean(G) and σ(G) represent the mean and standard deviation of the feature value respectively. The introduction of standardization can effectively reduce the deviation of the data and improve the convergence speed of the subsequent model, thereby enhancing the model's adaptability to the input data. Next, in the encoding module, three identical encoding blocks are designed, and the structure of each block is: input data G input After a fully connected layer, the nonlinear transformation is performed through the SELU activation function. The use of the SELU activation function can automatically adjust the mean and variance of the output, so that the output of each layer remains in a relatively stable range, thereby facilitating the training process of the deep learning model. Subsequently, the input passes through the Alpha Dropout layer, and the final output is formula (4): MR feature =Dropout(SELU(G input ),p)#(4); Where p is the dropout rate. The introduction of Alpha Dropout can not only prevent the model from overfitting, but also maintain the self-normalization characteristics of the data, thereby improving the generalization ability of the model on new samples. For each sequencing group, a self-normalization network is provided for encoding, which can fully explore the feature differences between different groups and effectively improve the accuracy and flexibility of encoding. S22 Image data encoding module: The constructed image data encoding module is used to effectively extract features from images of soil microorganisms. First, microbial images I in soil samples are collected through a high-resolution microscope. These images provide rich details and structural information of soil microorganisms. The module first divides the input soil microorganism image into six image blocks evenly according to length and width to support the input characteristics of the subsequent encoder and prompt the encoder to fully capture the details of different areas. The images after block division are set as I1-I6. The block processing helps to capture the spatial distribution characteristics of different microorganisms in the image and enhances the comprehensiveness of feature extraction. Subsequently, the linear projection method is used to process each block to map high-dimensional features to low-dimensional space. The formula is expressed as formula (5): in, is the projection result of the jth image block, w J and b j are weight matrix and bias respectively. Then, the block features are weighted through the self-attention layer so that the model can focus on the important areas in the image. The formula is expressed as formula (6): Among them, Q, K, and V represent query, key, and value respectively. k As the key dimension, the self-attention mechanism further enhances the model's ability to capture important features by calculating the relationship between blocks; Next, after further processing by the feedforward layer, the image feature I is finally obtained. feature , which contains six eigenvectors, among which the feedforward neural network not only improves the recognition accuracy of the model for soil microbial images, but also enhances the ability to capture microbial characteristics, ensuring the robustness of the model under different sample conditions.

4. The soil microorganism classification method based on deep learning according to claim 1, characterized in that: The construction process of the soil microorganism classification prediction model includes: In the soil microbial classification prediction model, the integrated feature normalization, co-attention fusion and residual splicing methods are mainly used to improve the classification accuracy. First, the extracted features are processed by feature normalization to eliminate the dimensional differences between different features. The feature normalization step combines batch normalization layer and layer normalization to ensure that the model can effectively cope with feature changes in both training and inference stages. Subsequently, the co-attention fusion module is introduced to convert the sequencing feature G feature and image feature I feature Effective combination,This module adopts the cross attention mechanism, which generates attention values ​​by interacting the queries (q), keys (k) and values ​​(v) of the two modalities, and then realizes the fusion of different modal information. This process not only enhances the expression ability of features, but also improves the model's ability to distinguish soil microorganism classification tasks. Finally, after processing by the microbial classification layer, the model outputs the final classification prediction results; The specific steps include: S31 Feature Standardization Module: In the constructed feature standardization module, different standardization methods are used for sequencing features and image features. In deep learning, standardization is an important preprocessing step to ensure that the input data is distributed within an appropriate range, which helps to avoid network instability caused by the increase in the number of layers. By pulling the data back to the standard normal distribution, the stability of training can be improved, the model can be converged faster, and the final performance can be improved. For sequencing features, the layer normalization method is used because its feature dimension is relatively small and the feature distribution of each sample varies greatly, so G can be obtained. fusion =LN(G feature ), relatively speaking, for image features, batch normalization method is used, thus obtaining I fusion =BN(I feature ), BN effectively reduces the internal covariate shift by standardizing the features in each training batch, so that the model can converge faster during the training process. BN is particularly suitable for processing image data because it can improve the robustness of the model in image scanning differences or image quality differences through normalization; S32 Co-attention fusion module: The co-attention fusion module constructed in this paper aims to effectively integrate sequencing features and image features to improve the accuracy of soil microbial classification. According to the paradigm of the attention mechanism, this module first extracts the sequencing features G fusion and image feature I fusion The query (q), key (k) and value (v) of G , K G , V G , the image feature is represented by Q I , K I , V I , Next, the attention weight between the sequencing features and the image features is calculated through the cross attention mechanism as shown in formula (7): Among them A G→I It represents the part of the image feature that is similar to its contribution, guided by the sequencing feature. The weight is applied to the value of the image feature, and the fused feature is expressed as Similarly, the attention weight of the image feature to the sequencing feature is calculated as formula (8): And applied to the value of the sequencing feature, another fused feature is obtained through residual connection and represented as Finally, the two fused features F G and F I Integration provides more comprehensive information for subsequent classification prediction. By focusing on the relationship between different modes, the fusion process effectively enhances the model's ability to distinguish soil microbial classification. S33 Microbial prediction module: After feature fusion, the constructed microbial prediction module first processes the features of each modality through two multi-head self-attention modules to deeply explore the knowledge related to the characteristics of soil microbial communities. After the self-attention module, the sequencing feature F′ can be obtained. G and image feature F′ I After feature concatenation, the final prediction feature for soil microbial classification can be obtained as shown in formula (9): Output=Concat(F′ G ,F′ I )#(9); Finally, the concatenated features will be input into a multi-layer perceptron, which consists of several fully connected layers to further refine the feature information and increase the expressive power of the model. After being processed by the activation function, they are finally classified and output through the Softmax layer to generate the predicted probability of each type of soil microorganism. This structure can effectively integrate information from different modalities.

5. The soil microorganism classification method based on deep learning according to claim 1, characterized in that: The learning strategy process of the multimodal feature alignment includes: In the learning strategy of multimodal feature alignment, the main method used is to construct positive and negative sample pairs to achieve feature alignment under contrastive learning. This part is performed before multimodal fusion. This is because the features of different modalities belong to different modal feature distribution spaces before fusion, making it difficult for the model to model the interaction relationship between different modalities, further reducing the reliability of multimodal fusion. Therefore, the extracted sequencing feature G is first feature and image feature I feature Corresponding feature mapping is performed to map the features of the two modalities to the same feature space, and then feature alignment is performed. Next, positive and negative sample pairs that support contrastive learning are constructed. According to the category of each soil microorganism, different modal features of the same category are used as positive sample pairs, and modal features of other categories different from the category are used as negative sample pairs. Finally, the contrastive learning strategy is used to constrain the positive and negative sample pairs. Specifically, the cosine similarity of the positive sample pairs is pulled in through the loss function, and at the same time, the Euclidean distance between the negative sample pairs is pushed away to achieve the alignment of modal features of the same category. Through the above method, the soil microorganism classification prediction model performs effective feature alignment before fusion, which promotes the model to learn multimodal fusion knowledge; The specific steps include: S41 Sequencing Feature Mapping Module: In the multimodal feature alignment module, in order to realize the sequencing feature G feature and image feature I feature To effectively integrate the two modalities, we first need to map them to the same feature space. To this end, we design two independent mapping networks to process sequencing data and image data respectively. feature The mapping network consists of three fully connected layers: the first layer has 128 nodes, the second layer has 64 nodes, and the third layer has 32 nodes. ReLU activation function is used between each layer. In order to stabilize the data distribution, a Batch Normalization layer is added between the second and third layers. The output after the network mapping is G contrast , which is projected into a 32-dimensional unified feature space. For the image feature I feature The mapping network structure is similar to the sequencing feature mapping network, and also contains three fully connected layers. The first layer has 128 nodes, the second layer has 64 nodes, and the third layer has 32 nodes. The network also uses BN for normalization between the second and third layers, and adds ReLU activation to each layer to enhance the nonlinear expression ability of the model; the output of the image feature map is I contrast , also in the 32-dimensional feature space; Through the above structure, the sequencing features and image features are mapped to the same feature space, which facilitates the interaction between modalities in the subsequent contrastive learning and feature alignment process; S42 positive and negative sample pair construction module: In the positive and negative sample pair construction module, a positive and negative sample pair construction method based on the mapping features of S41 is designed to achieve effective alignment and classification prediction of multimodal features. This module generates positive and negative sample pairs for each soil microbial category and further aligns the two modal features to promote consistency between multimodal features. First, the construction of positive sample pairs is based on the principle of the same category; it is assumed that the collected samples contain a total of N categories, and for one of the categories C i , i∈{1, 2, ..., N} soil microorganisms, in each training batch, the sequencing features G from this category contrast and image feature I contrast As a positive sample pair, the positive sample pair reduces the distance between the two modal features through the shared feature space expression, thereby achieving alignment on similar semantics. Then, the construction of the negative sample pair is based on the principle of different categories. For the target category C i The corresponding sequencing feature G contrast , image features of other categories I contrast Both are regarded as negative samples, and vice versa. This strategy forms a clear category boundary in the feature space by increasing the Euclidean distance between negative sample pairs, thus avoiding the overlap of features of different categories. S43 feature contrast learning module: In the feature contrast learning module, a contrast loss function based on InfoNCE is used to achieve effective alignment of features of different modalities. This loss function brings the positive and negative sample pairs of different modalities constructed based on S42 closer, thereby shortening the distance between features of the same category in the feature space, and then unifying the expression of the feature space before multimodal fusion; For each soil microbial sample pair, we will use the sequencing features G of the same category of the positive sample pair contrast and image feature I contrast The similarity is maximized, while the sequencing and image features of negative samples for different categories are minimized. Specifically, the InfoNCE loss function can be defined as formula (10): Where N is the number of categories contained in each batch, sim(·,·) represents the cosine similarity of the features, and T is the temperature parameter used to control the smoothness of the distribution. By maximizing the similarity of features of the same category and pushing features of different categories away in the feature space, this module can align sequencing features and image features, providing more discriminative feature representations for subsequent soil microbial classification tasks.

6. The soil microorganism classification method based on deep learning according to claim 1, characterized in that: The implementation method of soil microorganism classification includes: Based on the soil microbial classification prediction model designed in S3 and combined with the feature alignment learning strategy described in S4, an optimized soil microbial classification model is finally obtained. This optimized model is applied to soil sample analysis to achieve intelligent classification of soil microorganisms. The specific steps include: S51 Soil sample collection: By collecting soil samples from multiple locations, we can obtain rich sample materials and provide continuous and analyzable basic data for the verification and deployment of the post-model; S52 Sample data separation and extraction: Separate and extract the collected soil samples, and save them in groups in accordance with the model input paradigm to ensure that different types of samples can be processed independently for subsequent analysis; S53 data sub-modal processing: modal processing of the extracted high-throughput amplicon sequencing data and high-resolution microscopic image data, using operational classification units and precise sequence variants to extract sequencing data features, unify the resolution of soil microbial images, and ensure the accuracy and integrity of the data; S54 Microbial classification prediction model deployment: Deploy the optimized soil microbial classification prediction model to the analysis system, and send the processed data into the model for classification to obtain the specific distribution and classification results of soil microorganisms; S55 Multi-location soil microorganism prediction results: Summarize the soil microorganism classification results of different locations and conduct comparative analysis to reveal the distribution characteristics of regional soil microorganisms; S56 Soil Management and Resource Assessment: Based on the microbial classification results output by the model, soil management and resource assessment are carried out to provide data support for agriculture and environmental protection, and to improve soil utilization efficiency and ecological sustainability.

Citation Information

Cited By

  • Regional scale soil classification method and system based on multi-modal data

    CN119939364A