Visual or text task deep learning method based on adaptive topological structure
By introducing adaptive topology and linear complexity dynamic programming algorithms into deep learning, dynamic spanning tree topology and optimized feature propagation solve the problem of the traditional state space model's insufficient ability to capture spatial structure and long-distance dependencies in visual tasks. problem, significantly improving the performance and adaptability of the model.
Patent Information
- Application Number
- CN202410688286.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-30
- Publication Date
- 2024-08-23
- Estimated Expiration
- 2044-05-30
AI Technical Summary
Existing technologies cannot fully capture the inherent spatial structure and long-distance dependencies of input data in vision tasks. The traditional state space model adopts a fixed pattern scanning strategy, which limits the model's ability to capture spatial relationships, and the Mamba model has a fixed memory size. Limits the expansion and extrapolation capabilities of the state space.
A deep learning method based on adaptive topology is used to dynamically generate a minimum spanning tree by constructing an undirected m-connected graph and a tree topology scanning algorithm to achieve dynamic propagation and interaction of features, enhance the model's modeling ability of long-distance dependencies, and The feature propagation process is optimized through a dynamic programming algorithm with linear complexity.
It effectively improves the model's performance in visual and text tasks, especially in capturing long-distance dependencies and spatial relationships, improves the model's adaptability and computational efficiency, and is suitable for intelligent monitoring and quality inspection tasks in the security and industrial industries.
Smart Images

Figure CN118537702A
Abstract
Description
Technical Field
[0001] The present invention relates to the application of deep learning technology to visual or text tasks, and in particular to a deep learning method for visual or text tasks based on an adaptive topological structure. Background Art
[0002] The development of deep neural networks is an important catalyst for the exploration of machine visual perception. CNN-based models have become the first key milestones, among which ResNet stands out for its creative residual connection module and has been widely adopted in various fields of visual recognition. In addition, more efficient convolution operations have also emerged, such as the deep convolution introduced by MobileNet, paving the way for lightweight models. Subsequently, the Visual Transformer (ViT) redefined the paradigm of visual recognition. It redefined the architecture design and training mechanism by combining the Transformer architecture in natural language processing, aiming to improve computational efficiency and broaden the scope of application. Subsequent research has focused on hierarchical structure design, which designs the network by gradually reducing the feature resolution on the backbone network. In addition, recent research based on convolutional neural networks has once again emphasized the capabilities of convolutional networks. For example, InternImage proposed a large-scale model built on deformable convolution, while UniRepLKNet showed significant performance through large kernel convolution.
[0003] In the field of deep learning, state space models (SSMs) draw inspiration from control theory and have attracted attention for their advantages in sequence modeling. Structured state space models use structural parameter initialization to achieve stable optimization and superior computational performance. They are usually formulated as linear time-invariant systems that map input signals to output signals, which are transformed through state vectors.
[0004] In addition, state-space models (SSMs) have emerged as a novel class of models in the deep learning paradigm, showing great potential in sequence transformation. These methods have attracted widespread attention due to their linear scalability with sequence length. An early method, LSSL, draws inspiration from continuous state-space models in control systems and attempts to address the long-distance dependency problem by combining it with HIPPO[8] initialization. The S4 model proposes to normalize the parameters into a diagonal matrix, which has triggered a series of studies on structured SSMs. Recently, the selective state-space model, known as Mamba, strikes a balance between effectiveness and efficiency by designing an input-dependent parameter initialization strategy, which has become a strong competitor to the Transformer and CNN architectures. In addition to demonstrating excellent results in sequence modeling, Mamba also seamlessly integrates into the visual field. These studies usually rely on hand-crafted fixed scanning mechanisms to alleviate the performance bias of selective state-space models on 2D non-causal images.
[0005] The main drawback of existing technologies is that they cannot fully capture the inherent spatial structure and long-range dependencies of the input data. Especially in visual tasks, traditional SSMs usually adopt fixed-pattern scanning strategies, such as multi-directional raster scanning or local window scanning, which cannot effectively preserve the two-dimensional structural information of the image and limit the model's ability to capture spatial relationships. In addition, although the Mamba model performs well in sequence modeling, its fixed memory size limits the expansion of the state space, resulting in a decrease in the extrapolation ability during the scrolling process. In addition, the fixed propagation trajectory of the existing technology cannot dynamically adjust the topology and cannot adapt to changes in the input data.
[0006] It should be noted that the information disclosed in the above background technology section is only used for understanding the background of the present application, and therefore may include information that does not constitute prior art known to ordinary technicians in the field. Summary of the invention
[0007] The main purpose of the present invention is to overcome the defects of the above-mentioned background technology and provide a deep learning method for visual or text tasks based on adaptive topological structure.
[0008] To achieve the above object, the present invention adopts the following technical solutions:
[0009] In a first aspect of the present invention, a deep learning method for visual tasks based on an adaptive topological structure comprises:
[0010] Receive input data of a visual task and convert it into an embedded feature representation; the received input data of the visual task includes an image sequence, wherein the input feature representation is a pixel value of an image in the image sequence;
[0011] Based on the embedded features, an undirected m-connected graph is constructed, where nodes represent pixels in the image, edges connect adjacent pixels, and each pixel is connected to its m nearest neighbor pixels; the number of vertices corresponds to the input sequence length or the number of input pixels, and the weight of the edge is calculated based on the difference in the features of adjacent pixels;
[0012] By using feature dissimilarity, a minimum spanning tree (MST) is dynamically generated on the m-connected graph through a tree topology scanning algorithm. The sum of the edge weights of the tree is minimal, and the spatial and semantic information is encoded into the tree structure.
[0013] Through the tree topology scanning algorithm, each node in the tree structure is iteratively traversed, each node in the tree is used as a root node, the features from the child nodes are aggregated, and the state of the root node is updated using the state transfer function;
[0014] The feature data passes through multiple processing stages, each of which consists of multiple basic blocks to perform feature processing and spatial dimension transformation;
[0015] At the root node of the tree, the aggregated features are fused and further feature transformation and processing is performed;
[0016] The final state passes through the output layer and is finally processed according to the requirements of the visual task;
[0017] Based on the calculation of the output layer, the final visual task processing result is generated.
[0018] In a second aspect of the present invention, a text task deep learning method based on an adaptive topological structure comprises:
[0019] Receive input data for text tasks, such as sentences or documents, and convert them into numerical feature representations that the model can understand through the embedding layer;
[0020] Using the embedded features, an undirected m-connected graph is constructed, where nodes represent tokens in the text, such as words or characters, and edges connect adjacent tokens, representing the relationship between tokens to overcome the geometric constraints of text sequences; the weight of the edge is calculated based on the feature difference between adjacent tokens;
[0021] By analyzing the dissimilarity between the marked features, the minimum spanning tree (MST) is constructed using the tree topology scanning algorithm to provide a structural basis for state propagation and feature aggregation.
[0022] Through the tree topology scanning algorithm, each node of the tree topology structure is iteratively traversed, each node in the tree is used as a root node, the features from the child nodes are aggregated, and the state of the root node is updated using the state transfer function;
[0023] The feature data passes through multiple processing stages, each of which consists of multiple basic blocks. Each stage further extracts and transforms language features to capture deep patterns in the text data.
[0024] At the root node of the tree, the aggregated features are fused and further feature transformation and processing are performed to enhance the language representation;
[0025] The final state passes through the output layer and is finally processed according to the requirements of the text task;
[0026] Based on the calculation of the output layer, the final text task processing result is generated.
[0027] In a third aspect of the present invention, a computer program product comprises a computer program, wherein the computer program implements the method when executed by a processor.
[0028] Compared with the prior art, the present invention has the following beneficial effects:
[0029] The present invention effectively solves the shortcomings of state-space models (SSMs) in modeling long-distance dependencies. Since SSMs usually adopt a unidirectional loop propagation mechanism, although they are more efficient than Transformer models, they are limited in their representation ability, that is, capturing long-distance dependencies in sequence data. In addition, there are also great challenges in extending SSMs from one-dimensional sequence modeling to the field of two-dimensional visual space recognition. In response to these shortcomings, the present invention proposes a new method to enhance the long-distance modeling ability of SSMs by introducing an input-aware tree topology network. The present invention breaks the traditional sequence constraints and achieves more effective feature propagation and interaction through a dynamically generated tree topology structure, thereby improving the performance of the model in visual and text (language) tasks.
[0030] The method of the embodiment of the present invention is used to perform visual recognition tasks and natural language processing tasks, such as image classification, target detection, natural language understanding and text generation and classification. By introducing an adaptive tree topology structure and a dynamic programming algorithm with linear complexity, the performance of the deep learning model in visual and language tasks is improved, especially in capturing long-distance dependencies and spatial relationships. This adaptive tree topology structure enables the model to dynamically generate the optimal topological connection based on the input features, effectively capturing long-distance dependencies in sequence data. At the same time, the dynamic programming algorithm with linear complexity solves the quadratic complexity problem in traditional tree structure propagation, realizes an efficient feature propagation mechanism, allows the model to capture important long-distance information while maintaining computational efficiency, enhances the model's ability to capture spatial relationships, and improves the adaptability of the state space model in visual and language tasks. These advantages make the present invention have significant application value in intelligent monitoring equipment in the security industry and intelligent quality inspection algorithms in the industrial industry, and can achieve higher-precision target detection and improve the accuracy and efficiency of industrial quality inspection.
[0031] Other beneficial effects of the embodiments of the present invention will be further described below. BRIEF DESCRIPTION OF THE DRAWINGS
[0032] Figure 1 Scanning strategy graphs for existing visual state space.
[0033] Figure 2 State space propagation strategy diagram for existing text.
[0034] Figure 3 Schematic diagram of a tree state space model according to an embodiment of the present invention.
[0035] Figure 4 Schematic diagram of the GrootV architecture according to an embodiment of the present invention. DETAILED DESCRIPTION
[0036] The following is a detailed description of the embodiments of the present invention. It should be emphasized that the following description is only exemplary and is not intended to limit the scope and application of the present invention.
[0037] The embodiment of the present invention provides a deep learning method for visual tasks based on an adaptive topological structure, comprising: receiving input data of a visual task and converting it into an embedded feature representation; the received input data of the visual task includes an image sequence, wherein the input feature representation is a pixel value of an image in the image sequence; the visual task may be a task such as image classification or target detection; based on the embedded features, constructing an undirected m-connected graph, wherein nodes represent pixels in the image, edges connect adjacent pixels, and each pixel is connected to its m nearest neighbor pixels; the number of vertices corresponds to the length of the input sequence or the number of input pixels, and the weight of the edge is calculated based on the difference of adjacent pixel features; m is preferably 4; utilizing feature dissimilarity, dynamically generating on the m-connected graph through a tree topology scanning algorithm The minimum spanning tree MST has the smallest sum of edge weights and encodes spatial and semantic information into the tree structure. Through the tree topology scanning algorithm, each node in the tree structure is iteratively traversed, each node in the tree is used as the root node, the features from the child nodes are aggregated, and the state of the root node is updated using the state transfer function. The feature data passes through multiple processing stages, each stage consists of multiple basic blocks, and performs feature processing and spatial dimension transformation, such as feature extraction, conversion, and downsampling, to reduce the spatial dimension and increase the number of feature channels. At the root node of the tree, the aggregated features are fused for further feature transformation and processing. The final state passes through the output layer and is finally processed according to the requirements of the visual task. Based on the calculation of the output layer, the final visual task processing result is generated.
[0038] See also Figure 3 In a preferred embodiment, the visual task deep learning method adopts a tree state space model, which includes the following submodules: an embedding module, which converts the input visual data into an embedded feature representation; a graph construction module: which constructs an undirected m-connected graph, where vertices represent pixel embeddings and edges represent spatial relationships between pixels; a pruning module: which uses a shrinking Boruvka algorithm to prune the edges in the graph, generate a minimum spanning tree MST, and optimize the sum of edge weights; a state space model initialization module: which initializes the state for each node in the MST and prepares for dynamic state updates; a tree topology scanning module: which iteratively traverses each vertex, regards it as a root node, aggregates features from other vertices, and updates the state; a parameter generator: which generates a data-related transformation matrix for state propagation; a feature propagation and interaction module: which realizes dynamic propagation and interaction of features through a tree topology structure; an activation function module: which uses SiLU and SoftPlus activation functions to introduce nonlinearity and enhance the expressiveness of the model; a linear transformation module: which transforms features through a series of linear layers; an output layer: which performs final processing according to the requirements of the visual task and generates prediction results.
[0039] In a preferred embodiment, in the tree topology scanning algorithm: cosine distance is used as a measure of distance between vertices; the shrinking Boruvka algorithm is applied to prune the edges in the graph to generate a minimum spanning tree MST; for each node, the aggregation state is calculated based on the transformation matrix and path weight of its parent node; the derivative of the output hidden state with respect to the input variable is derived to achieve end-to-end training of the model; based on the aggregated state and the original input features, the output features are calculated for subsequent visual task processing.
[0040] In a preferred embodiment, the tree topology scanning algorithm implements dynamic programming, which specifically includes (see the algorithm shown in Table 1 below): receiving input features, input matrices and state matrices of the visual task, and the gradient of the loss function; performing a breadth-first search BFS on the spanning tree to obtain a topological sorting order; updating the state from the leaf node to the root node in the topological sorting order through forward propagation; for each node, updating the state of the current node according to the state and related parameters of its child nodes; if the current node is a root node, directly using the input features and the state matrix to determine its state; if it is not a root node, then updating the state of the parent node according to the state and related parameters of the parent node; The input features of the current node calculate the state of the current node; through back propagation, from the root node to the leaf node, the gradient is updated again in the topological sorting order; for each node, the gradient of the current node is updated according to the gradient of the child node and the state of the current node. For the root node, the gradient update is directly related to the state matrix and the input matrix. For non-root nodes, the gradient update needs to consider the gradient of the parent node and the state of the current node; thus, the state propagation process is optimized through dynamic programming to achieve linear complexity propagation; based on the updated state matrix and input features, the output features are generated for subsequent visual task processing.
[0041] The embodiment of the present invention significantly improves the performance of the state space model in processing long-distance dependencies and two-dimensional visual space recognition by introducing an adaptive tree topology network and a linear complexity dynamic programming algorithm. The adaptive tree topology structure can dynamically generate the optimal connection according to the input features and effectively capture the long-distance dependencies in the sequence data, while the linear complexity algorithm solves the problem of high computational cost in the traditional tree structure propagation and realizes efficient feature propagation. As a result, the model performs well in visual recognition tasks such as image classification and target detection, especially in capturing long-distance dependencies and spatial relationships. The present invention can be used for intelligent monitoring equipment in the security industry and intelligent quality inspection in the industrial industry, and can significantly improve target detection accuracy and industrial quality inspection efficiency.
[0042] In another embodiment, the present invention also provides a text task deep learning method based on an adaptive topological structure, comprising: receiving input data of a text task, such as a sentence or a document, and converting it into a numerical feature representation that can be understood by a model through an embedding layer; the text task can be a task such as text generation or text classification; using the embedded features, constructing an undirected m-connected graph, in which nodes represent tags in the text, such as words or characters, and edges connect adjacent tags, representing the relationship between tags, so as to overcome the geometric constraints of the text sequence; the weight of the edge is calculated based on the feature difference between adjacent tags; m is preferably 3; by analyzing the dissimilarity between the tag features, a minimum tree topology scanning algorithm is used to construct a minimum The MST tree is generated to provide a structural basis for state propagation and feature aggregation; through the tree topology scanning algorithm, each node of the tree topology structure is iteratively traversed, each node in the tree is used as the root node, the features from the child nodes are aggregated, and the state of the root node is updated using the state transfer function; the feature data passes through multiple processing stages, each stage consists of multiple basic blocks, and each stage further extracts and transforms language features to capture deep patterns in text data; at the root node of the tree, the aggregated features are fused, and further feature transformation and processing are performed to enhance language representation; the final state passes through the output layer and is finally processed according to the needs of the text task; based on the calculation of the output layer, the final text task processing result is generated.
[0043] In some embodiments, in the tree topology scanning algorithm: cosine distance is used as a measure of distance between vertices; the shrinking Boruvka algorithm is applied to prune edges in the graph to generate a minimum spanning tree MST; based on the causal prediction method in the text task, the last tag of the sentence or document is selected as the root node; the derivative of the output hidden state with respect to the input variable is derived to achieve end-to-end training of the model; the output features are calculated based on the aggregated state and the original input features for subsequent text task processing.
[0044] In a preferred embodiment, the tree topology scanning algorithm implements dynamic programming, which specifically includes (see the algorithm shown in Table 2 below): receiving input features, input matrix and state matrix of the text task, and loss function gradient. Performing breadth-first search BFS on the spanning tree to obtain a topological sorting order; updating the state from leaf node to root node in topological sorting order through forward propagation; calculating and updating the gradient from root node to leaf node in topological sorting order through back propagation; for the root node, the gradient update is directly related to the state matrix and the input matrix, and for non-root nodes, the gradient update needs to consider the gradient of the parent node and the state of the current node; thus, the state propagation process is optimized through dynamic programming to achieve linear complexity propagation; generating output features based on the updated state matrix and input features for subsequent text task processing.
[0045] The embodiment of the present invention significantly improves the performance of the state-space model in processing long-distance dependencies and two-dimensional visual space recognition by introducing an adaptive tree topology network and a linear complexity dynamic programming algorithm. The adaptive tree topology structure can dynamically generate optimal connections based on input features and effectively capture long-distance dependencies in sequence data, while the linear complexity algorithm solves the problem of high computational cost in traditional tree structure propagation and achieves efficient feature propagation. As a result, the present invention performs well in natural language processing tasks such as natural language understanding and text generation and classification, especially in capturing long-distance dependencies and spatial relationships.
[0046] The specific embodiments of the present invention are further described below.
[0047] In the following specific embodiment, a tree state space model is constructed and a network named GrootVL is proposed. This is an innovative network framework that can include two sub-networks GrootV and GrootL, which are designed for visual and language tasks respectively. The core idea of GrootVL is to dynamically generate a tree topology structure based on input features and spatial relationships, and perform feature propagation on this structure. A schematic diagram of a tree state space model is shown in Figure 2. Figure 3 shown.
[0048] Tree topology scanning algorithm
[0049] Given an input feature Where L is the sequence length (or the number of input pixels), an undirected m-connected graph G = (V, E) is constructed for the feature. Where m is a hyperparameter representing the number of neighboring tags. In visual tasks, m = 4 means that each pixel is connected to its four neighboring pixels. For language tasks, m = 3 is set by default, indicating that each tag is connected to the previous three tags. In addition, the vertex V represents the pixel (or tag) embedding, and E represents the edge of the graph. The edge weight is calculated by the feature dissimilarity between adjacent vertices. In addition, the distance metric between vertices uses the cosine distance by default. The contraction Boruvka algorithm is used to prune edges with significant differences, thereby generating a minimum spanning tree (MST) whose sum of difference weights is the smallest among all spanning trees. During the propagation process, each vertex is iterated, regarded as the root, and the features of the remaining vertices are aggregated. Intuitively, applying state propagation in such a geometric configuration will preferentially interact between vertices with smaller spatial and feature distances. Referring to Mamba, state propagation is performed using a data-dependent transformation matrix. For vertex k, the transformation matrix for the parent node is represented as Therefore, the state aggregation process of the i-th vertex can be expressed as:
[0050]
[0051] Where Ω represents the index set of all vertices in the tree. S(E ij ) represents the hyperedge E ij The path weight from the jth vertex to the ith vertex in the MST, N ij Represents the index set of all vertices on this hyperedge. For visual tasks, iterate each vertex, treat it as the root of the spanning tree, and aggregate the states from other vertices to obtain the transformed state For text tasks, due to the causal prediction method in large language models, only the last token is taken as the root and aggregated from other tokens. In order to achieve end-to-end training, the output hidden state hi is derived for the input variable and x j The derivative of is as follows:
[0052]
[0053]
[0054] in represents the child node of vertex k with vertex i as the root, and n is the parent node of vertex k. Finally, the output feature Y can be expressed as:
[0055] Y=C⊙Norm(H)+D⊙X,
[0056] Where Y, H and X represent and ⊙ represents element-wise multiplication.
[0057] In order to deal with the resulting quadratic complexity, a dynamic programming algorithm is proposed to implement the propagation of linear complexity to enhance long-distance interactions without increasing computational costs. This algorithm optimizes the state propagation process, allowing GrootVL to achieve more effective long-distance dependency modeling while maintaining computational efficiency. The pseudo code of the visual tree topology scanning algorithm that implements dynamic programming is shown in Table 1:
[0058] Table 1
[0059]
[0060] The pseudo code for implementing the text tree topology scanning algorithm for dynamic programming is shown in Table 2:
[0061] Table 2
[0062]
[0063] Based on the above basic operators, corresponding networks can be constructed for different visual and text tasks. In visual tasks, GrootV first uses the dissimilarity between adjacent features to construct a minimum spanning tree (MST) on a four-connected plane graph. This process can adaptively encode spatial and semantic information into the tree graph. Then, by iteratively traversing each pixel and treating it as a root node, the features of other pixels are aggregated using Mamba's state transition function. Figure 4 A preferred GrootV architecture is shown.
[0064] like Figure 4 As shown, based on the GrootV architecture, the visual task processing method of the specific embodiment includes the following steps:
[0065] 1. Input processing: Receive input data for vision tasks, such as image sequences, and convert the pixel values of each image into embedded feature representations.
[0066] 2. Graph construction: Based on the embedded features, a minimum spanning tree (MST) is constructed on a four-connected planar graph, where each pixel is regarded as a node in the graph and is connected to the other four nearest neighbor pixels.
[0067] 3. Feature dissimilarity analysis: We exploit the dissimilarity between adjacent features to adaptively encode spatial and semantic information into the tree graph.
[0068] 4. Tree topology scanning: Iterate through each pixel node and regard it as the root node, and use Mamba's state transfer function to aggregate the features of other pixels.
[0069] 5. Multi-stage feature processing: Feature data passes through multiple processing stages, each of which consists of multiple basic blocks to perform feature extraction, conversion, and downsampling. In each stage, the tree state space model and down sampling techniques are applied to reduce the spatial dimension and increase the number of feature channels.
[0070] 6. Feature fusion and transformation: At the root node of the tree, the aggregated features are fused and further feature transformation and processing are performed through linear layers, SiLU activation functions, SoftPlus functions, etc.
[0071] 7. Output layer processing: The final state passes through the output layer (Head) and is finally processed according to the requirements of the visual task (such as classification Cls., detection Det., segmentation Seg.).
[0072] 8. Result generation: Based on the calculation of the output layer, the final visual task processing results are generated, such as category labels, object detection boxes, segmentation maps, etc.
[0073] pass Figure 4 The GrootV network shown in this embodiment can effectively process visual tasks, capture key information in images, and provide accurate visual recognition results.
[0074] For language tasks, the GrootL network overcomes the geometric constraints of text sequences by constructing a tree topology based on the dissimilarity of labeled features. The GrootL of the embodiment uses a similar aggregation process to GrootV (not described here), which can significantly enhance the language representation capabilities of pre-trained large language models.
[0075] In summary, the method of the embodiment of the present invention is used to perform visual recognition tasks and natural language processing tasks, such as image classification, target detection, natural language understanding and text generation and classification. By introducing an adaptive tree topology structure and a dynamic programming algorithm with linear complexity, the performance of the deep learning model in visual and language tasks is improved, especially in capturing long-distance dependencies and spatial relationships. This adaptive tree topology structure enables the model to dynamically generate the optimal topological connection according to the input features, effectively capturing the long-distance dependencies in the sequence data. At the same time, the dynamic programming algorithm with linear complexity solves the quadratic complexity problem in the traditional tree structure propagation, realizes an efficient feature propagation mechanism, allows the model to capture important long-distance information while maintaining computational efficiency, enhances the model's ability to capture spatial relationships, and improves the adaptability of the state space model in visual and language tasks. These advantages make the present invention have significant application value in the intelligent monitoring equipment of the security industry and the intelligent quality inspection algorithm of the industrial industry, and can achieve higher-precision target detection and improve the accuracy and efficiency of industrial quality inspection.
[0076] Compared with the conventional technology, the innovations and advantages of the embodiments of the present invention are mainly reflected in the following aspects:
[0077] 1. Adaptive tree topology: The model can dynamically generate a tree topology based on the input features, which enables the model to adaptively capture spatial and semantic information, thereby enhancing the ability to model long-distance dependencies.
[0078] 2. Feature propagation with linear complexity: The dynamic programming algorithm with linear complexity effectively solves the high complexity problem in traditional tree structure propagation. This mechanism effectively reduces the computational cost while maintaining the model's ability to capture long-distance dependencies.
[0079] 3. By introducing an adaptive tree topology structure, the limitations of the traditional state-space model in visual tasks are improved and the model's ability to capture spatial relationships is enhanced.
[0080] 4. Compared with other visual recognition methods based on state-space models, the method of the present invention can more comprehensively and systematically improve the two-dimensional spatial perception ability of the model and achieve comprehensive and systematic visual recognition improvement.
[0081] The deep learning method for visual tasks based on adaptive topology can be used in security monitoring tasks to achieve real-time monitoring and detection of various objects and higher-precision target detection. It can also be used in industrial quality inspection tasks to improve the accuracy and efficiency of industrial quality inspection, improve detection results and product quality, and reduce labor costs.
[0082] An embodiment of the present invention further provides a storage medium for storing a computer program, which at least performs the above method when executed.
[0083] An embodiment of the present invention further provides a control device, comprising a processor and a storage medium for storing a computer program; wherein the processor is configured to execute at least the method described above when executing the computer program.
[0084] An embodiment of the present invention further provides a processor, wherein the processor executes a computer program and at least executes the method described above.
[0085] The storage medium can be implemented by any type of non-volatile storage device, or a combination thereof. Among them, the non-volatile memory can be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), a magnetic random access memory (FRAM), a ferromagnetic random access memory (Flash Memory), a magnetic surface memory, an optical disc, or a compact disc read-only memory (CD-ROM); the magnetic surface memory can be a disk memory or a tape memory. The storage medium described in the embodiments of the present invention is intended to include, but is not limited to, these and any other suitable types of memory.
[0086] In the several embodiments provided by the present invention, it should be understood that the disclosed systems and methods can be implemented in other ways. The device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as: multiple units or components can be combined, or can be integrated into another system, or some features can be ignored or not executed. In addition, the coupling, direct coupling, or communication connection between the components shown or discussed can be through some interfaces, and the indirect coupling or communication connection of the devices or units can be electrical, mechanical or other forms.
[0087] The units described above as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units; some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0088] In addition, all functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may be separately used as a unit, or two or more units may be integrated into one unit; the above-mentioned integrated units may be implemented in the form of hardware or in the form of hardware plus software functional units.
[0089] A person skilled in the art can understand that: all or part of the steps of implementing the above method embodiment can be completed by hardware related to program instructions, and the aforementioned program can be stored in a computer-readable storage medium. When the program is executed, it executes the steps of the above method embodiment; and the aforementioned storage medium includes: mobile storage devices, read-only memories (ROM, Read-Only Memory), random access memories (RAM, Random Access Memory), disks or optical disks, etc. Various media that can store program codes.
[0090] Alternatively, if the above-mentioned integrated unit of the present invention is implemented in the form of a software function module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the embodiment of the present invention can be essentially or partly reflected in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the methods described in each embodiment of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as mobile storage devices, ROM, RAM, magnetic disks or optical disks.
[0091] The methods disclosed in the several method embodiments provided by the present invention can be arbitrarily combined without conflict to obtain new method embodiments.
[0092] The features disclosed in several product embodiments provided by the present invention can be arbitrarily combined without conflict to obtain new product embodiments.
[0093] The features disclosed in several method or device embodiments provided by the present invention can be arbitrarily combined without conflict to obtain new method embodiments or device embodiments.
[0094] The above contents are further detailed descriptions of the present invention in combination with specific preferred embodiments, and it cannot be determined that the specific implementation of the present invention is limited to these descriptions. For those skilled in the art of the present invention, several equivalent substitutions or obvious variations can be made without departing from the concept of the present invention, and the performance or use is the same, which should be regarded as belonging to the protection scope of the present invention.
Claims
1. A deep learning method for visual tasks based on adaptive topological structure, characterized in that: include: Receive input data for a visual task and convert it into an embedded feature representation; The received visual task input data includes an image sequence, wherein the input features are represented as pixel values of images in the image sequence; Based on the embedded features, an undirected m-connected graph is constructed, where nodes represent pixels in the image, edges connect adjacent pixels, and each pixel is connected to its m nearest neighbor pixels; the number of vertices corresponds to the input sequence length or the number of input pixels, and the weight of the edge is calculated based on the difference in the features of adjacent pixels; By using feature dissimilarity, a minimum spanning tree (MST) is dynamically generated on the m-connected graph through a tree topology scanning algorithm. The sum of the edge weights of the tree is minimal, and the spatial and semantic information is encoded into the tree structure. Through the tree topology scanning algorithm, each node in the tree structure is iteratively traversed, each node in the tree is used as a root node, the features from the child nodes are aggregated, and the state of the root node is updated using the state transfer function; The feature data passes through multiple processing stages, each of which consists of multiple basic blocks to perform feature processing and spatial dimension transformation; At the root node of the tree, the aggregated features are fused and further feature transformation and processing is performed; The final state passes through the output layer and is finally processed according to the requirements of the visual task; Based on the calculation of the output layer, the final visual task processing result is generated.
2. The method for deep learning of visual tasks based on adaptive topological structure according to claim 1, characterized in that: A tree state space model is adopted, which includes the following submodules: An embedding module, which converts the input visual data into an embedded feature representation; Graph construction module: It constructs an undirected m-connected graph, where vertices represent pixel embeddings and edges represent spatial relationships between pixels; Pruning module: It uses the contraction Boruvka algorithm to prune the edges in the graph, generate the minimum spanning tree MST, and optimize the sum of edge weights; State space model initialization module: It initializes the state of each node in the MST and prepares for dynamic state updates; Tree topology scanning module: It iterates through each vertex, treating it as a root node, aggregates features from other vertices, and updates the state; Parameter generator: It generates the data-dependent transition matrix for state propagation; Feature propagation and interaction module: It realizes dynamic propagation and interaction of features through tree topology structure; Activation function module: It uses SiLU and SoftPlus activation functions to introduce nonlinearity and enhance the expressiveness of the model; Linear transformation module: transforms features through a series of linear layers; Output layer: Performs final processing and generates prediction results according to the requirements of the visual task.
3. The method for deep learning of visual tasks based on adaptive topological structure according to claim 1 or 2, characterized in that: In the tree topology scanning algorithm: using cosine distance as a measure of distance between vertices; Apply the shrinking Boruvka algorithm to prune the edges in the graph to generate the minimum spanning tree MST; For each node, the aggregation state is calculated based on the transition matrix and path weight of its parent node; Derive the derivatives of the output hidden state with respect to the input variables to enable end-to-end training of the model; Based on the aggregated state and the original input features, the output features are calculated for subsequent visual task processing.
4. The method for deep learning of visual tasks based on adaptive topological structure according to any one of claims 1 to 3, characterized in that: The tree topology scanning algorithm implements dynamic programming, which specifically includes: Receive input features, input matrix and state matrix of the visual task, as well as the loss function gradient; Perform a breadth-first search (BFS) on the spanning tree to obtain a topological sort order; Through forward propagation, the state is updated from leaf nodes to root nodes in topological sorting order; For each node, update the state of the current node according to the state of its child nodes and related parameters. If the current node is the root node, directly use the input features and state matrix to determine its state. If it is not the root node, calculate the state of the current node according to the state of the parent node and the input features of the current node. Through back propagation, from the root node to the leaf node, the gradient is updated again in the topological sorting order; For each node, the gradient of the current node is updated according to the gradient of the child node and the state of the current node. For the root node, the gradient update is directly associated with the state matrix and the input matrix. For non-root nodes, the gradient update needs to consider the gradient of the parent node and the state of the current node. Therefore, the state propagation process is optimized through dynamic programming to achieve linear complexity propagation; Based on the updated state matrix and input features, output features are generated for subsequent visual task processing.
5. The method for deep learning of visual tasks based on adaptive topological structure according to any one of claims 1 to 4, characterized in that: The visual task includes image classification or target detection; preferably, m is 4.
6. A text task deep learning method based on adaptive topological structure, characterized in that: include: Receive input data for text tasks, such as sentences or documents, and convert them into numerical feature representations that the model can understand through the embedding layer; Using the embedded features, an undirected m-connected graph is constructed, where nodes represent tokens in the text, such as words or characters, and edges connect adjacent tokens, representing the relationship between tokens to overcome the geometric constraints of text sequences; the weight of the edge is calculated based on the feature difference between adjacent tokens; By analyzing the dissimilarity between the marked features, the minimum spanning tree (MST) is constructed using the tree topology scanning algorithm to provide a structural basis for state propagation and feature aggregation. Through the tree topology scanning algorithm, each node of the tree topology structure is iteratively traversed, each node in the tree is used as a root node, the features from the child nodes are aggregated, and the state of the root node is updated using the state transfer function; The feature data passes through multiple processing stages, each of which consists of multiple basic blocks. Each stage further extracts and transforms language features to capture deep patterns in the text data. At the root node of the tree, the aggregated features are fused and further feature transformation and processing are performed to enhance the language representation; The final state passes through the output layer and is finally processed according to the requirements of the text task; Based on the calculation of the output layer, the final text task processing result is generated.
7. The text task deep learning method based on adaptive topology structure as claimed in claim 6, characterized in that: In the tree topology scanning algorithm: using cosine distance as a measure of distance between vertices; Apply the shrinking Boruvka algorithm to prune the edges in the graph to generate the minimum spanning tree MST; based on the causal prediction method in text tasks, select the last token of the sentence or document as the root node; Derive the derivatives of the output hidden state with respect to the input variables to enable end-to-end training of the model; Based on the aggregated state and the original input features, the output features are calculated for subsequent text task processing.
8. The text task deep learning method based on adaptive topological structure according to claim 6 or 7, characterized in that: The tree topology scanning algorithm implements dynamic programming, which specifically includes: Receives input features, input matrix and state matrix of the text task, as well as the loss function gradient. Perform a breadth-first search (BFS) on the spanning tree to obtain a topological sort order; Through forward propagation, the state is updated from leaf nodes to root nodes in topological sorting order; Through back propagation, the gradient is calculated and updated from the root node to the leaf node in the topological sorting order; For the root node, the gradient update is directly related to the state matrix and the input matrix. For non-root nodes, the gradient update needs to consider the gradient of the parent node and the state of the current node. Therefore, the state propagation process is optimized through dynamic programming to achieve linear complexity propagation; According to the updated state matrix and input features, output features are generated for subsequent text task processing.
9. The text task deep learning method based on adaptive topology structure according to any one of claims 6 to 8, characterized in that: The text task includes text generation or text classification; preferably, m is 3.
10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the method according to any one of claims 1 to 9 is implemented.
Citation Information
Patent Citations
Network rumor detection method based on multi-level propagation structure representation
CN115688689A
Deep text clustering method and device for adaptive structure learning
CN116483999A
Self-adaptive dynamic adjustment method and system for spatial topological structure of coupling system
CN117767426A
Systems, methods, and storage media for creating image data embeddings to be used for image recognition
US20220292877A1
