A social content depression detection method based on bidirectional gated convolutional network

Using bidirectional gated convolutional networks and Bi-GRU to detect depression in social media content solves the problems of long training time and insufficient feature information in the existing technology, achieves fast and accurate depression detection, and reduces noise interference. Improved detection accuracy.

CN114491289BActive Publication Date: 2024-09-17NANJING UNIV OF INFORMATION SCI & TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202111674925.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-31
Publication Date
2024-09-17
Estimated Expiration
2041-12-31

AI Technical Summary

Technical Problem

Existing technologies have problems such as long training time, over-fitting, insufficient feature information, and noise in depression detection of social media content. Moreover, the visual attention mechanism relies on syntactic analysis and external knowledge, making it difficult to detect quickly and accurately.

Method used

A bidirectional gated convolutional network is used to obtain text and images of social content, perform vectorization processing and multi-scale filter convolution, and combine Bi-GRU and word vector emotional attention mechanisms to learn image-specific attention weights and reduce noise. and improve the richness of feature representation.

Benefits of technology

It achieves fast and accurate depression detection, improves the comprehensiveness of emotional feature representation and detection accuracy, reduces dependence on external knowledge, and improves model speed and utilization of social information.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114491289B
    Figure CN114491289B
Patent Text Reader

Abstract

The invention discloses a social content depression detection method of a bidirectional gated convolutional network. The method comprises the following steps: obtaining text and images in social content, performing vectorization processing on the text, and obtaining a word vector sequence; constructing a part-of-speech position attention feature matrix according to the word vector sequence, calculating an input matrix of a convolutional network, and then obtaining a multi-channel convolution feature through a multi-scale filter convolution; encoding the word vector sequence using Bi‑GRU to obtain a word representation, and distributing weights between words through a word vector sentiment attention mechanism to obtain a sentence representation; encoding the image through a residual attention network, and then learning image-specific attention weights through a visual attention mechanism, and aggregating the image-specific text representation with the sentence representation; aggregating the image-specific text by learning the image-specific text importance weights to obtain a final text representation; performing feature splicing on the multi-channel convolution feature and the final text representation, and then obtaining whether the image is depressed and the severity of the depression through a softmax classifier.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to a social content depression detection method of a bidirectional gated convolutional network, belonging to the technical field of depression detection. Background Art

[0002] According to statistics, there are currently 350 million depression patients in the world, and the patient population is gradually getting younger, with 20-50 years old becoming the most common age group. Therefore, there is an urgent need for a method to screen and diagnose depression early. In recent years, with the popularization of the Internet and its virtualized and complex characteristics, more and more patients like to express and vent their emotions on social media. Therefore, finding an effective, fast and accurate depression detection method on social media has become a task that needs to be solved urgently.

[0003] Currently, the content of social media mainly consists of multimodal information including pictures and text. Current research uses the visual attention mechanism to enhance the effect of images on text when processing text information, but there are still some problems: first, the bidirectional long short-term memory network (Bi-LSTM) is often used for text processing. Although it can handle sequence problems well, it is prone to problems such as long training time, overfitting, and insufficient feature information; secondly, there is a noise problem in the extraction of image features in the visual attention module, and the current attention mechanism relies more on external knowledge such as syntactic analysis, and cannot perform detection quickly and accurately. Summary of the invention

[0004] The purpose of the present invention is to overcome the deficiencies in the prior art and provide a social content depression detection method based on a bidirectional gated convolutional network to perform fast and accurate depression detection on social content.

[0005] In order to achieve the above object, the technical solution adopted by the present invention is:

[0006] The present invention provides a social content depression detection method using a bidirectional gated convolutional network, comprising the following steps:

[0007] Obtain text and images from social content, vectorize the words in the text, and obtain a word vector sequence;

[0008] Construct the part-of-speech position attention feature matrix according to the word vector sequence, calculate the input matrix of the convolutional network, and then obtain the multi-channel convolution feature through multi-scale filter convolution;

[0009] Use Bi-GRU to encode the word vector sequence to get the word representation, and use the word vector sentiment attention mechanism to assign weights between words to get the sentence representation;

[0010] The image is encoded through the residual attention network, and then the image-specific attention weights are learned through the visual attention mechanism, which are aggregated with the sentence representation into an image-specific text representation;

[0011] Image-specific text is aggregated to obtain the final text representation by learning image-specific text importance weights;

[0012] The multi-channel convolution features are concatenated with the final text representation, and then the depression and severity of depression are obtained through the softmax classifier.

[0013] Furthermore, the text in the social content is divided into L sentences s i , sentence i From T words w i,t , where i∈(1,…,L), t∈(1,…,T).

[0014] Furthermore, the input matrix of the convolutional network is calculated as follows:

[0015]

[0016] Among them, z e is the input matrix of the convolutional network, e is the target word position, δ is the influence degree, ε is the weight coefficient, and A e is the part-of-speech attention feature matrix, tag e is the part-of-speech vector, P is the sentence position matrix, and n is the sentence length.

[0017] Furthermore, the input matrix of the convolutional network is convolved with 3-5 groups of filters of different scales, each group of filters has 128 filters, and the stride is set to 1.

[0018] Furthermore, the word vector sentiment attention mechanism allocates weights between words to obtain the calculation of sentence representation as follows:

[0019] u i,t =U T tanh(h i,t W w +b w )

[0020]

[0021] h i =Σ t h i,t h i,t

[0022] Among them, u i,t is the relative importance, U T is the context vector, tanh is the nonlinear activation function, hi,t is the word representation, W w is the word weight matrix, b w is the word bias, α i,t is the word attention weight, h i Represents a sentence.

[0023] Furthermore, a residual attention network is used to encode images in social content, including stacking multiple residual attention blocks (RAB) based on ResNet-101 as a feature selector to enhance the good feature representation of the trunk branch and suppress the noise of the trunk branch.

[0024] Furthermore, the process of encoding the image is as follows:

[0025] m j =f(V j )

[0026] V j =T(a j )*(1+M(a j ))

[0027] Among them, m j is the image representation, f is the visual attention function, V j is the spatial eigenvector, a j is the image, T(a j ) is the main branch output, M(a j ) is the mask branch output, j∈(1,…,E) is the image position taken, and E is the number of images.

[0028] Furthermore, the visual attention mechanism is processed as follows:

[0029] p j =tanh(W p m j +b p )

[0030] q i =tanh(W q h i +b q )

[0031] v j,i =V T (p j *q i +q i )

[0032]

[0033] d j =∑ i βj,i h i

[0034] Among them, p j is the image projection, W p is the image corresponding weight, m j is the image representation, b p represents the image deviation, q i is the sentence projection, W q is the sentence weight, h i For sentence representation, b q represents sentence deviation, v j,i is the attention value, V T is the learning vector, β j,i is the image-specific attention weight, d j A specific text representation for an image.

[0035] Furthermore, the final text representation is calculated as follows:

[0036] k j =K T tanh(d j W d +b d )

[0037]

[0038] d=∑ i γ j d j

[0039] Among them, k j is d j The importance of K T is the global context attention vector, W d is d j The corresponding weight matrix, b d is the text deviation, γ j is the image-specific text importance weight, and d is the final text representation.

[0040] The present invention also provides a computer system, including a processor and a storage medium;

[0041] The storage medium is used to store instructions;

[0042] The processor is used to operate according to the instructions to execute the steps of any of the methods described above.

[0043] Compared with the prior art, the present invention has the following beneficial effects:

[0044] The present invention uses a multi-channel convolutional network to extract spatial local features of different fine-grained documents, and uses Bi-GRU to learn the background semantic association information of the text to improve the richness and comprehensiveness of the emotional feature representation;

[0045] A part-of-speech position attention mechanism is added before multi-channel convolution to overcome the limitation of relying solely on content-level information, allowing the model to obtain deeper information without relying on external knowledge;

[0046] Use Bi-GRU to encode word vector sequences, retain the forward and reverse bidirectional learning of text, and reduce the operation time to improve the speed of the model;

[0047] The residual attention block is introduced to reduce noise and improve detection accuracy. The visual attention mechanism is introduced to identify important sentences, reduce noise interference, and improve the utilization of social information and classification accuracy. BRIEF DESCRIPTION OF THE DRAWINGS

[0048] Figure 1 It is a framework diagram of a social content depression detection method using a bidirectional gated convolutional network provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0049] The present invention will be further described below in conjunction with the accompanying drawings. The following embodiments are only used to more clearly illustrate the technical solution of the present invention, and cannot be used to limit the protection scope of the present invention.

[0050] like Figure 1 As shown, it is a framework diagram of a social content depression detection method of a bidirectional gated convolutional network provided by an embodiment of the present invention. The present invention combines a bidirectional gated network (Bi-GRU) and a multi-channel convolutional network, considers the possibility of combining the part-of-speech and position attention mechanism with the convolutional network, and at the same time, introduces a residual attention module to further reduce noise and improve detection accuracy. Specifically, the following steps are included:

[0051] (1) The text in social content can be divided into L sentences s i (i∈(1,…,L)), sentence s i From T words w i,t (t∈(1,…,T)); use Word2vec to train each word w i,t Vectorize and get the word vector sequence x i,t ,This method can avoid the dimensionality curse problem in text representation and improve the accuracy of semantic representation.

[0052] (2) Construct the part-of-speech position attention feature matrix, and then calculate the input matrix of the multi-granularity convolutional network. The specific calculation process of the input matrix is ​​as follows:

[0053]

[0054] Among them, z e is the input matrix of the convolutional network, e is the target word position, δ is the influence degree, ε is the weight coefficient, and A e is the part-of-speech attention feature matrix, tage is the part-of-speech vector, P is the sentence position matrix, and n is the sentence length.

[0055] Map each part of speech into a part of speech vector tag e , the part-of-speech vector of the target word is recorded as tar and used as the part-of-speech attention feature matrix A e , ε takes 1.2 for sentiment words and 1.0 for other words. The present invention adopts a bidirectional scanning algorithm to more accurately determine the position value between words and targets, and uses a matrix P to store the position values ​​of all sentences, and then calculates δ.

[0056] (3) Use filters of different scales to convolve the feature information of different fine-grained levels of the sentence, unify the dimensions of the generated feature vectors, and concatenate the results to obtain the output feature representation of the multi-channel convolution.

[0057] Among them, multi-scale convolution uses 3-5 groups of filters of different scales to convolve the feature information of different fine-grained sentences respectively. The sizes of the five groups of filters are 2*128, 3*128, 4*128, 5*128, and 6*128 respectively. The embodiment of the present invention sets 128 filters in each group and the stride is set to 1.

[0058] (4) Use Bi-GRU to encode the word vector sequence, and then convert the hidden state vectors at different times, i.e., the word representation h i,t After concatenation, weights are assigned between words through the word vector sentiment attention mechanism, and finally all words in the current sentence represent h i,t and their word attention weights α i,t The weighted summation produces the sentence representation h i .

[0059] The word vector sentiment attention mechanism process is as follows:

[0060] u i,t =U T tanh(h i,t W w +b w )

[0061]

[0062] h i =∑ i α i,t h i,t

[0063] Among them, u i,t is the relative importance, U T is the context vector, tanh is the nonlinear activation function, h i,t is the word representation, W w is the word weight matrix, b w is the word bias, α i,t is the word attention weight, h i Represents a sentence.

[0064] Represent the word h i,t Through a layer of neurons with a nonlinear activation function tanh, we get a representation in the attention space, which is then combined with the context vector U T Multiply to get u i,t , normalized using Softmax to generate word attention weight a i,t , finally, the sentence represents h i All words in the current sentence represent h i,t and their word attention weights α i,t A weighted sum is produced.

[0065] (5) The visual component consists of E images a j (j∈(1,…,E)), encode the images in the social content, and get the image representation m j , and then learn the image-specific attention weight β of the sentence for each image j,i , aggregate sentence representations into image-specific text representations d j , learn image-specific text importance weights γ j , and aggregate into the final text representation d;

[0066] The process of encoding an image is as follows:

[0067] m j =f(V j )

[0068] V j =T(a j )*(1+M(a j ))

[0069] Among them, m j is the image representation, f is the visual attention function, V j is the spatial eigenvector, a j is the image, T(a j ) is the main branch output, M(a j ) is the mask branch output, j∈(1,…,E) is the image position taken, and E is the number of images.

[0070] Multiple residual attention blocks (RABs) are stacked on top of ResNet-101 as feature selectors to enhance the good feature representation of the backbone branches and suppress the noise of the backbone branches.

[0071] The visual attention mechanism generation process is as follows:

[0072] Get the sentence representation h i Finally, we need to give more weight to important sentences, and here we use visual attention:

[0073] p j =tanh(W p m j +b p )

[0074] q i =tanh(W q h i +b q )

[0075] v j,i =V T (p j *q i +q i )

[0076]

[0077] d j =∑ i β j,i h i

[0078] Among them, p j is the image projection, W p is the image corresponding weight, m j is the image representation, b p represents the image deviation, q i is the sentence projection, W q is the sentence weight, h i For sentence representation, b q represents sentence deviation, v j,i is the attention value, V T is the learning vector, β j,i is the image-specific attention weight, d j is the image-specific text representation, S i is a sequence of sentence vectors.

[0079] Let the image be m j And the sentence represents h iMultiply them with their corresponding weights respectively, project them into an attention space, and scale them to the same value range through a nonlinear activation function to obtain their respective projections; interact the two projections by element-wise multiplication and summation. Element-wise multiplication ensures that the influence of the visual part is not eliminated when calculating the attention weight, and summation ensures that the effect of the text part is not significantly weakened due to the sparsity of the visual part. Generate the attention value v j,i , the image-specific attention weight β is obtained by softmax normalization j,i , and then aggregate the sentence representations into image-specific text representations d j .

[0080] Next, we learn the image-specific text importance weights γ j , indicating how much each image-specific text representation dj will contribute to the final text representation d, calculated as:

[0081] k j =K T tanh(d j W d +b d )

[0082]

[0083] d=∑ i γ j d j

[0084] Among them, k j is d j The importance of K T is the global context attention vector, W d is d j The corresponding weight matrix, b d is the text deviation, γ j is the importance weight, and d is the final text representation.

[0085] Image specific text representation j Projected into the attention space by neurons with nonlinear activation function tanh, d j The attention weight of the image with the text γ j are aggregated together into the final text representation d.

[0086] (6) The output representations of the two models are concatenated and fed into two softmax classifiers, one of which generates a label of whether the patient is depressed and the other predicts the severity of depression.

[0087] The present invention also provides a computer system, including a processor and a storage medium, wherein the storage medium is used to store instructions, and the processor is used to operate according to the instructions to execute the steps of any of the above methods.

[0088] The present invention combines Bi-GRU and multi-granularity convolutional networks to learn the background semantic association information of the text while obtaining more spatial local feature information, and improves the operation speed by reducing the number of parameters. Secondly, the part-of-speech and position attention mechanisms are added to the convolutional network, allowing the model to receive parallelized input text information, utilize and learn the deeper emotional information of the input text, and make up for the shortcomings of relying solely on the content-level attention mechanism. At the same time, the residual attention module is added to realize image feature extraction, reduce noise, and improve accuracy. Finally, the diagnosis of depression and the rapid and accurate diagnosis of severity can be completed through social media content.

[0089] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the technical principles of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.

Claims

1. A social content depression detection method based on a bidirectional gated convolutional network, characterized in that: The steps include: Obtain text and images from social content, vectorize the text, and obtain a word vector sequence; Construct the part-of-speech position attention feature matrix according to the word vector sequence, calculate the input matrix of the convolutional network, and then obtain the multi-channel convolution feature through multi-scale filter convolution; Use Bi-GRU to encode the word vector sequence to get the word representation, and use the word vector sentiment attention mechanism to assign weights between words to get the sentence representation; The image is encoded through the residual attention network, and then the image-specific attention weights are learned through the visual attention mechanism, which are aggregated with the sentence representation into an image-specific text representation; Image-specific text is aggregated to obtain the final text representation by learning image-specific text importance weights; The multi-channel convolution features are concatenated with the final text representation, and then the depression and severity of depression are obtained through the softmax classifier; The input matrix of the convolutional network is calculated as follows: , in, is the input matrix of the convolutional network, is the target word position, For the degree of impact, is the weight coefficient, is the part-of-speech attention feature matrix, is the part-of-speech vector, is the sentence position matrix, is the sentence length; The calculation of the word vector sentiment attention mechanism to allocate weights between words is as follows: , in, For relative importance, is the context vector, is a nonlinear activation function, For word representation, is the word weight matrix, is the word deviation, is the word attention weight, Represents a sentence.

2. According to claim 1, a method for detecting depression in social content using a bidirectional gated convolutional network is characterized in that: The text in the social content is divided into Sentences ,sentence Depend on Words Composition, of which , .

3. According to claim 1, a method for social content depression detection using a bidirectional gated convolutional network is characterized in that: The input matrix of the convolutional network is convolved with 3-5 groups of filters of different scales, each group of filters has 128 filters, and the stride is set to 1.

4. The method for social content depression detection using a bidirectional gated convolutional network according to claim 1, characterized in that: We use a residual attention network to encode images in social content, consisting of stacking multiple residual attention blocks (RABs) based on ResNet-101 as a feature selector.

5. The method for social content depression detection using a bidirectional gated convolutional network according to claim 1, characterized in that: The process of encoding an image through a residual attention network is as follows: , in, For image representation, is the visual attention function, is the spatial eigenvector, For images, Output for the main branch. is the mask branch output, is the image position, is the number of images.

6. The method for social content depression detection using a bidirectional gated convolutional network according to claim 1, characterized in that: The visual attention mechanism is processed as follows: , in, For image projection, is the image corresponding weight, For image representation, represents the image deviation, Projection for the sentence, is the sentence weight, For the sentence, Indicates sentence deviation, is the attention value, To learn the vector, is the image-specific attention weight, A specific text representation for an image.

7. The method for social content depression detection using a bidirectional gated convolutional network according to claim 6, characterized in that: The final text representation is calculated as follows: , in, for The importance of is the global context attention vector, for The corresponding weight matrix is, is the text deviation, is the image-specific text importance weight, The final text representation.

8. A computer system, characterized in that: including processor and storage medium; The storage medium is used to store instructions; The processor is used to operate according to the instructions to execute the steps of the method according to any one of claims 1 to 7.