Unimolecular electrical data analysis method based on fusion attention mechanism

By constructing a convolutional neural network with fusion attention mechanism, the problems of loss of detailed information and insufficient interpretability in single-molecular electrical data analysis in the prior art are solved, and efficient and accurate classification and identification of single-molecular conductance data are achieved.

CN120542485APending Publication Date: 2025-08-26XIANGTAN UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510600409.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-09
Publication Date
2025-08-26

AI Technical Summary

Technical Problem

Existing deep learning methods are prone to loss of detailed information and long range dependencies when analyzing single-molecular electrical data, making it difficult to accurately identify and classify events in single-molecular conductance data, and lack interpretability.

Method used

A convolutional neural network adopts a fusion attention mechanism, including feature extraction module, spatial attention module, multi-head attention module and object recognition module, to build a convolutional neural network for the classification and recognition of single-molecular electrical conduction trajectory image data.

Benefits of technology

Improves the accuracy and efficiency of detecting target molecules in mixed solutions, can capture tiny vibration characteristics and long range dependencies, enhances the interpretability of the model and is low in computational cost.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120542485A_ABST
    Figure CN120542485A_ABST
Patent Text Reader

Abstract

The invention relates to the field of single-molecule electrical transport, and discloses a single-molecule electrical data analysis method based on a fusion attention mechanism. The method comprises the following steps: step 1, acquiring a single-molecule conductance trajectory training set; step 2, constructing a convolutional neural network; step 3, training a convolutional neural network; step 4, detecting the monomolecular mixed solution; through the arrangement of the convolutional neural network, the construction of the convolutional neural network composed of a feature extraction module, an attention module and a recognition module is facilitated, and the attention module feature extraction performance of the network is efficient and the network has a more accurate capturing capability for tiny vibration features in data. The method overcomes the problem of low detection efficiency in the existing method, and is particularly suitable for identifying the proportion of the target molecules in the mixed solution under the background of a small amount of data sets and a complex environment.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of single-molecule electrical transport, and more specifically to a single-molecule electrical data analysis method based on a fusion attention mechanism. Background Art

[0002] Deep learning methods are widely used to analyze STM-BJ data. However, these methods are prone to missing tiny details of the target and long-range dependencies between data, resulting in loss of detailed information. For example, the single-molecule conductance data measured by STM-BJ contains tiny vibrations in the conductance platform. These vibrations often contain important information about changes in molecular structure. However, existing methods find it difficult to capture these tiny changes, and the models often cannot provide a reasonable explanation for the prediction results. Therefore, they are not suitable for single-molecule electrical data analysis.

[0003] Prior art has made new progress in unsupervised vector classification of single-molecule charge transport data and deep learning for identifying molecular connectivity features. However, single-molecule conductance curve data contain multiple events, and existing technologies do not address how to accurately determine the number of events involved. Furthermore, these models often lack the interpretability required for accurate identification and classification of single-molecule charge transport. In light of this, the present invention proposes a single-molecule electrical data analysis method based on a fused attention mechanism for detecting mixed solutions containing different ratios of target molecules. Summary of the Invention

[0004] In order to overcome the above-mentioned defects of the prior art, the present invention provides a single-molecule electrical data analysis method based on a fusion attention mechanism, which adopts a convolutional neural network with a fusion attention mechanism to classify and identify single-molecule conductance trajectory image datasets, so that the network can accurately detect the proportion of target molecules in the mixed solution, thereby solving the problems existing in the above-mentioned background technology.

[0005] The present invention provides the following technical solution: a single-molecule electrical data analysis method based on a fusion attention mechanism, comprising the following steps:

[0006] Step 1, obtain the single-molecule conductance trajectory training set;

[0007] Step 2: Build a convolutional neural network;

[0008] Step 3: train the convolutional neural network;

[0009] Step 4: Detecting the single-molecule mixed solution.

[0010] Preferably, the convolutional neural network is composed of a feature extraction module, an attention module, and a target recognition module connected in sequence;

[0011] The feature extraction module has a total of 3 layers, the attention module includes a spatial attention module and a multi-head attention module; the structure of the target recognition module includes a first fully connected layer, a ReLU activation layer and a second fully connected layer.

[0012] Preferably, the structure of the spatial attention module is: a 1×1 convolutional layer and a Sigmoid activation layer, wherein the number of input channels of the convolutional layer is 64 and the number of output channels is 1. The convolutional layer does not use padding during calculation, the stride is 1, and after Sigmoid activation, the output attention map is normalized to the range of [0, 1];

[0013] The structure of the multi-head attention module includes three convolutional layers, the convolution kernel size is 1×1, the stride is 1, and the padding is 0; the number of input channels of the three convolutional layers is 64, and the number of output channels is 64, which generate query vectors, key vectors and value vectors respectively.

[0014] Preferably, the spatial attention module is specifically:

[0015] Max pooling and average pooling; for a given feature map with size (H, W, C), where H is the height, W is the width, and C is the number of channels; let f(i, j) be the value at position (i, j) in the feature map, and the maximum value of all channels at position (i, j) is calculated as:

[0016] max_pool(i,j)=max(f(i,j,c)); where max_pool represents maximum pooling; the maximum merged feature map is obtained, with dimensions (H, W);

[0017] The formula for calculating the average value of all channels at position (i, j) is expressed as:

[0018] avg_pool(i,j)=mean(f(i,j,c)); where avg_pool represents average pooling; the average merged feature map is obtained, with dimensions (H, W);

[0019] After obtaining the maximum pooled and average pooled feature maps, they are concatenated along the channel axis to form a new feature map of dimension (H, W, 2C).

[0020] Preferably, the new feature map learns the weight of each spatial position through a convolutional layer and a Sigmoid activation function; the weight is calculated as follows: let W_conv be the output of the convolutional layer applied to the cascaded feature map; the weight calculation formula for each spatial position (i, j) is expressed as:

[0021] weights(i,j)=sigmoid(W_conv(i,j)); where weights(i,j) represents the weight of position (i,j);

[0022] The weights are applied to each spatial position on the original feature map to obtain the final attention-aware feature map; the formula is expressed as:

[0023] attention_map(i,j,c)=f(i,j,c)*weights(i,j); where attention_map represents the final attention-perceived feature map.

[0024] Preferably, the multi-head self-attention module is specifically:

[0025] Linear transformation: Each feature vector is processed by three different linear layers to generate the corresponding query vector Q, keyword vector K and value vector V;

[0026] Calculate attention scores: For each query vector, calculate a dot product with all key vectors to obtain a set of attention scores; which represents the strength of the relationship between the features of the query vector and other feature vectors; specifically, given a set of fragments F = {f1; f2; ...; fk};

[0027] Compute the input query vector, key vector, and value vector: in, The subscript t represents the t-th head; df represents the stacked features of the image region; the attention scores are normalized by the softmax function to ensure that all scores are between 0 and 1 and the sum is 1;

[0028] Perform multi-head processing: Each space corresponds to a separate "head", and the output vectors obtained from each head are concatenated to form the final output result; expressed as:

[0029]

[0030] MultiHead(F)=concat(head1,…,head h )W 0 ;

[0031] Among them, W 0 ∈Rhdv×d K ; h represents the number of heads.

[0032] Preferably, the structure of the target recognition module includes: a first fully connected layer, a ReLU activation layer, and a second fully connected layer, wherein the input feature dimension of the first fully connected layer is 9216, and the output feature dimension is 128;

[0033] The second fully connected layer has an input feature dimension of 128 and an output feature dimension of 3. It is responsible for mapping the feature sequence activated by the first fully connected layer and ReLU to the final classification output space with 3 categories.

[0034] Preferably, the calculation of the input volume function and the output volume function of the convolutional layer is specifically as follows:

[0035] Let the input volume be V in =(N,C,H,W), where N is the batch size, C is the number of input channels, H is the height of the input feature map, and W is the width of the input feature map; the output volume of the convolutional layer is V out The shape is (N,K,H out ,W out ); where K is the number of convolution kernels and the output height H out With output width W out The calculation formula is expressed as:

[0036]

[0037] Among them, F represents the size of the convolution kernel, and P represents the size of the padding.

[0038] Technical effects and advantages of the present invention:

[0039] (1) The present invention is advantageous in that it is provided with a convolutional neural network, which is conducive to constructing a convolutional neural network consisting of a feature extraction module, an attention module and a recognition module. Since the feature extraction performance of the attention module of the network is efficient and it has a more accurate capture capability of small vibration features in the data, it overcomes the problem of low detection efficiency in the existing methods and is particularly suitable for identifying the proportion of target molecules in a mixed solution in a small amount of data set and a complex environmental background.

[0040] (2) By adding an attention module to the convolutional network, the present invention is able to more accurately capture the long-range dependencies between data and overcome the problem of weak model interpretability in existing methods. At the same time, it has a lower computational cost and has the potential for large-scale application without affecting accuracy. BRIEF DESCRIPTION OF THE DRAWINGS

[0041] Figure 1 This is a flow chart of the single-molecule electrical data analysis method based on the fusion attention mechanism of the present invention.

[0042] Figure 2 This is a structural diagram of the convolutional neural network model of the present invention.

[0043] Figure 3 It is a one-dimensional conductivity statistical diagram for predicting the ratio of mixed solutions according to the present invention.

[0044] Figure 4 It is a two-dimensional conductivity statistical graph for predicting the ratio of mixed solutions according to the present invention. DETAILED DESCRIPTION

[0045] The technical solutions of the present invention will be described clearly and completely below in conjunction with the drawings in the present invention. In addition, the forms of the various structures described in the following embodiments are merely examples. The single-molecule electrical data analysis method based on the fusion attention mechanism involved in the present invention is not limited to the various structures described in the following embodiments. All other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.

[0046] like Figure 1 As shown, the present invention provides a single-molecule electrical data analysis method based on a fusion attention mechanism, comprising the following steps:

[0047] Step 1: Obtain a single-molecule conductance trajectory training set; the single-molecule conductance trajectory training set is obtained by measuring with an STM-BJ instrument, and each signal trajectory is made into a 100*100*1 grayscale image and labeled;

[0048] Step 2: Build a convolutional neural network;

[0049] The convolutional neural network is composed of a feature extraction module, an attention module, and a target recognition module connected in sequence;

[0050] Step 3: Train the convolutional neural network. Input the target detection training set into the convolutional neural network and use the gradient descent method to update the weights of the convolutional neural network until the loss function value approaches 0, thus obtaining a trained convolutional neural network.

[0051] Step 4: Detecting the single-molecule mixed solution: Mix the single-molecule solutions at different ratios and measure them using the STM-BJ instrument. The measured results are plotted as a 100*100*1 grayscale image and input into the trained neural network. The output classifies the single molecules in the image and uses the ratio of the number of output classes as the predicted concentration ratio of the single-molecule solution.

[0052] Figure 3 and Figure 4 These are 1D and 2D statistical graphs after classifying the mixed solution; Mixture represents the mixed solution, and T, A, and B represent three different single molecule categories. As can be seen from the figure, this embodiment can well separate different single molecule categories from the mixed solution and can perform data separation on mixed solutions of any different proportions.

[0053] In this embodiment, it should be specifically explained that, Figure 2 As shown, the feature extraction module has 3 layers, and its structure is as follows: the first Maxpooling layer → the first convolution layer → the first Batch Normalization layer → the second Maxpooling layer → the second convolution layer → the second Batch Normalization layer → the third convolution layer → the third Maxpooling layer → the third convolution layer → the third Batch Normalization layer, and the number of convolution kernels in the first to third convolution layers is set to 16, 32 and 64 respectively; the size of the convolution kernel is set to 3×3, the step size is set to 2, and each convolution layer performs convolution operation, ReLU activation processing and dorp out (0.25) processing. The convolution layer performs a convolution operation, and the width and height are reduced to half of the original when downsampling, and the number of channels is increased to twice the original. The normalization process is to normalize each batch of data, and the processing method used is min-batch SGD; the normalization function is expressed as:

[0054] Among them, z a represents the weight of the ath feature before updating, s a represents the weight of the ath feature after update, and C is the number of channels;

[0055] The attention module includes a spatial attention module and a multi-head attention module; initially, a proportional coefficient of 0.5 is assigned to each of the two. The structure of the spatial attention module is: a 1×1 convolution layer and a Sigmoid activation layer, wherein the number of input channels of the convolution layer is 64 and the number of output channels is 1, which is used to generate a spatial attention map. The convolution layer does not use padding during calculation, the stride is 1, and after Sigmoid activation, the output attention map is normalized to the range of [0, 1], thereby providing weighting for the spatial area of ​​the input feature map; the structure of the multi-head attention module is: three convolution layers (the convolution kernel size is 1×1, the stride is 1, and the padding is 0) → calculate the query, key, and value → calculate the attention score → Generate output, where the number of input channels of the three convolutional layers is 64, and the number of output channels is 64, generating query, key and value respectively; when calculating the attention score, matrix multiplication is used to multiply the query and the transpose of the key, and the result is scaled back and the attention weight is calculated using the Softmax function to obtain the relative importance of each feature position, and finally the weighted value is converted into output through matrix multiplication; by using 8 heads to calculate attention in parallel, the model can aggregate information from multiple feature subspaces, thereby guiding the model to focus on the key areas in the input feature map and improving the feature representation ability of the model; finally, the results of the spatial attention module and the multi-head self-attention model are weighted and summed to obtain the final output of the attention layer.

[0056] In this embodiment, it should be specifically explained that the spatial attention module is specifically:

[0057] Max pooling and average pooling; for a given feature map with size (H, W, C), where H is the height, W is the width, and C is the number of channels; let f(i, j) be the value at position (i, j) in the feature map, and the maximum value of all channels at position (i, j) is calculated as:

[0058] max_pool(i,j)=max(f(i,j,c)); where max_pool represents maximum pooling; the maximum merged feature map is obtained, with dimensions (H, W);

[0059] The formula for calculating the average value of all channels at position (i, j) is expressed as:

[0060] avg_pool(i,j)=mean(f(i,j,c)); where avg_pool represents average pooling; the average merged feature map is obtained, with dimensions (H, W);

[0061] After obtaining the maximum pooled and average pooled feature maps, they are concatenated along the channel axis to form a new feature map of dimension (H, W, 2C);

[0062] The new feature map learns the weight of each spatial position through the convolution layer and the Sigmoid activation function; the weight is calculated as follows: let W_conv be the output of the convolution layer applied to the cascaded feature map; the weight calculation formula for each spatial position (i, j) is expressed as:

[0063] weights(i,j)=sigmoid(W_conv(i,j)); where weights(i,j) represents the weight of position (i,j);

[0064] Apply the weights to each spatial position on the original feature map to obtain the final attention-aware feature map; this can be achieved by multiplying each channel value in the original feature map by its corresponding weight, as expressed in the formula:

[0065] attention_map(i,j,c)=f(i,j,c)*weights(i,j); where attention_map represents the final attention-perceived feature map.

[0066] In this embodiment, it should be specifically explained that the multi-head self-attention module is specifically:

[0067] Linear transformation: Each feature vector is processed by three different linear layers to generate the corresponding query vector Q, keyword vector K and value vector V;

[0068] Calculate attention scores: For each query vector, calculate a dot product with all key vectors to obtain a set of attention scores; which represents the strength of the relationship between the features of the query vector and other feature vectors; specifically, given a set of fragments F = {f1; f2; ...; fk};

[0069] Compute the input query vector, key vector, and value vector: in, The subscript t denotes the t-th head; df denotes the stacked features of the image region; this results in a "dot product attention" weight matrix or affinity matrix. In addition, the attention scores are normalized by the softmax function to ensure that all scores are between 0 and 1 and sum to 1; the normalized attention scores are then multiplied by the corresponding value vector and the results are summed to obtain the final output vector; the weighted sum is expressed as:

[0070]

[0071] Multi-head processing: The above process is performed in parallel in multiple different linear spaces, each corresponding to a separate "head". The output vectors obtained from each head are concatenated to form the final output result; it can be expressed as:

[0072]

[0073] MultiHead(F)=concat(head1,…,head h )W 0 ;

[0074] Among them, W 0 ∈Rhdv×d K ;h represents the number of heads;

[0075] This module can not only quickly locate the spatial structure of conductance trajectories in graphics, but also be used to capture long-range dependencies in conductance trajectories. It not only improves the detection efficiency of single-molecule mixed solutions, but also enhances the interpretability of the model.

[0076] In this embodiment, it should be specifically explained that the structure of the target recognition module is: first fully connected layer → ReLU activation layer → second fully connected layer, wherein the input feature dimension of the first fully connected layer is 9216, and the output feature dimension is 128, and the feature dimension is reduced from 9216 to 128 by linear transformation; the ReLU activation layer is used to introduce nonlinearity so that the model can better adapt to complex data distribution; the second fully connected layer has an input feature dimension of 128 and an output feature dimension of 3, and is responsible for mapping the feature sequence activated by the first fully connected layer and ReLU to the final classification output space, with the number of categories being 3; the parameters of the fully connected layer are optimized by min-batch SGD to reduce the loss function, thereby improving the classification performance of the model in the single-molecule mixed solution detection task;

[0077] The calculation of the input volume function and the output volume function of the convolutional layer is specifically as follows:

[0078] Let the input volume be V in =(N,C,H,W), where N is the batch size, C is the number of input channels, H is the height of the input feature map, and W is the width of the input feature map; the output volume of the convolutional layer is V out The shape is (N,K,H out ,W out ); where K is the number of convolution kernels and the output height H out With output width W out The calculation formula is expressed as:

[0079]

[0080] Among them, F represents the size of the convolution kernel, and P represents the size of the padding;

[0081] The input volume of the first convolutional layer is (N, 1, H, W), and the output volume is (N, 16, H / 2, W / 2); the input volume of the second convolutional layer is (N, 16, H / 2, W / 2), and the output volume is (N, 32, H / 4, W / 4); the input volume of the third convolutional layer is (N, 32, H / 4, W / 4), and the output volume is (N, 64, H / 8, W / 8). In each convolutional layer operation, the convolution kernel size is set to 3×3, and the stride and padding are adjusted as needed to achieve downsampling and feature extraction.

[0082] Finally: The above description is only a preferred embodiment of the present invention and is 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 scope of protection of the present invention.

[0083] The above description is merely a specific embodiment of the present application, but the scope of protection of the present application is not limited thereto. Any changes or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in this application should be included in the scope of protection of this application. Therefore, the scope of protection of this application should be based on the scope of protection of the claims.

Claims

1. A single-molecule electrical data analysis method based on a fusion attention mechanism, characterized by: The following steps are involved: Step 1, obtain the single-molecule conductance trajectory training set; Step 2: Build a convolutional neural network; Step 3: train the convolutional neural network; Step 4: Detecting the single-molecule mixed solution.

2. The single-molecule electrical data analysis method based on the fusion attention mechanism according to claim 1, characterized in that: The convolutional neural network is composed of a feature extraction module, an attention module, and a target recognition module connected in sequence; The feature extraction module has 3 layers, and the attention module includes a spatial attention module and a multi-head attention module; The structure of the target recognition module includes a first fully connected layer, a ReLU activation layer and a second fully connected layer.

3. The single-molecule electrical data analysis method based on the fusion attention mechanism according to claim 2, characterized in that: The structure of the spatial attention module is: a 1×1 convolutional layer and a Sigmoid activation layer, where the number of input channels of the convolutional layer is 64 and the number of output channels is 1. The convolutional layer does not use padding during calculation and has a stride of 1. After Sigmoid activation, the output attention map is normalized to the range of [0, 1]. The structure of the multi-head attention module includes three convolutional layers, the convolution kernel size is 1×1, the stride is 1, and the padding is 0; the number of input channels of the three convolutional layers is 64, and the number of output channels is 64, which generate query vectors, key vectors and value vectors respectively.

4. The single-molecule electrical data analysis method based on the fusion attention mechanism according to claim 3, characterized in that: The spatial attention module is specifically: Max pooling and average pooling; for a given feature map with size (H, W, C), where H is the height, W is the width, and C is the number of channels; let f(i, j) be the value at position (i, j) in the feature map, and the maximum value of all channels at position (i, j) is calculated as: max_pool(i,j)=max(f(i,j,c)); where max_pool represents maximum pooling; the maximum merged feature map is obtained, with dimensions (H, W); The formula for calculating the average value of all channels at position (i, j) is expressed as: avg_pool(i,j)=mean(f(i,j,c)); where avg_pool represents average pooling; the average merged feature map is obtained, with dimensions (H, W); After obtaining the maximum pooled and average pooled feature maps, they are concatenated along the channel axis to form a new feature map of dimension (H, W, 2C).

5. The single-molecule electrical data analysis method based on the fusion attention mechanism according to claim 4, characterized in that: The new feature map learns the weight of each spatial position through the convolution layer and the Sigmoid activation function; the weight is calculated as follows: let W_conv be the output of the convolution layer applied to the cascaded feature map; the weight calculation formula for each spatial position (i, j) is expressed as: weights(i,j)=sigmoid(W_conv(i,j)); where weights(i,j) represents the weight of position (i,j); The weights are applied to each spatial position on the original feature map to obtain the final attention-aware feature map; the formula is expressed as: attention_map(i,j,c)=f(i,j,c)*weights(i,j); where attention_map represents the final attention-perceived feature map.

6. The single-molecule electrical data analysis method based on the fusion attention mechanism according to claim 5, characterized in that: The multi-head self-attention module is specifically: Linear transformation: Each feature vector is processed by three different linear layers to generate the corresponding query vector Q, keyword vector K and value vector V; Calculate attention scores: For each query vector, calculate a dot product with all key vectors to obtain a set of attention scores; which represents the strength of the relationship between the features of the query vector and other feature vectors; specifically, given a set of fragments F = {f1; f2; ...; fk}; Compute the input query vector, key vector, and value vector: in, The subscript t represents the t-th head; df represents the stacked features of the image region; the attention scores are normalized by the softmax function to ensure that all scores are between 0 and 1 and the sum is 1; Perform multi-head processing: Each space corresponds to a separate "head", and the output vectors obtained from each head are concatenated to form the final output result; expressed as: MultiHead(F)=concat(head1,…,head h )W 0 ; Among them, W 0 ∈Rhdv×d K ; h represents the number of heads.

7. The single-molecule electrical data analysis method based on the fusion attention mechanism according to claim 6, characterized in that: The structure of the target recognition module includes: a first fully connected layer, a ReLU activation layer, and a second fully connected layer, wherein the input feature dimension of the first fully connected layer is 9216 and the output feature dimension is 128; The second fully connected layer has an input feature dimension of 128 and an output feature dimension of 3. It is responsible for mapping the feature sequence activated by the first fully connected layer and ReLU to the final classification output space with 3 categories.

8. The single-molecule electrical data analysis method based on the fusion attention mechanism according to claim 7, characterized in that: The calculation of the input volume function and the output volume function of the convolutional layer is specifically as follows: Let the input volume be V in =(N,C,H,W), where N is the batch size, C is the number of input channels, H is the height of the input feature map, and W is the width of the input feature map; the output volume of the convolutional layer is V out The shape is (N,K,H out ,W out ); where K is the number of convolution kernels and the output height H out With output width W out The calculation formula is expressed as: Among them, F represents the size of the convolution kernel, and P represents the size of the padding.