Design and construction method of deep learning framework module for large-scale remote sensing images

By embedding the large-format remote sensing feature module at the deep learning framework level, and using automatic data segmentation, intermediate layer representation, and compilation optimization, the problem of information loss and accuracy decline in large-format remote sensing image processing is solved, and efficient large-format image training is achieved. and reasoning capabilities, suitable for general deep learning frameworks.

CN113869172BActive Publication Date: 2024-10-15WUHAN UNIV +1
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202111106138.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-09-22
Publication Date
2024-10-15
Estimated Expiration
2041-09-22

AI Technical Summary

Technical Problem

When the existing deep learning framework processes large-format remote sensing images, the edge pixel features of the sample image are insufficient through block processing, resulting in information loss and reduced accuracy. It also fails to integrate the intelligent interpretation capabilities of large-format remote sensing images from the framework level.

Method used

A set of modules is designed to embed large-format remote sensing characteristics from the deep learning framework level. Through automatic data segmentation, intermediate layer representation and compilation optimization, it adopts multi-level hierarchical structure, operator decomposition and operator fusion, combined with the parallelism of reinforcement learning. Strategies to optimize models for large-format image processing.

Benefits of technology

It realizes the efficient training and reasoning capabilities of the deep learning framework for large-format remote sensing images, reduces the memory usage of the calculation graph, and improves the processing accuracy. It is suitable for any front-end framework, and has a modular design that can be plugged into a general deep learning framework.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113869172B_ABST
    Figure CN113869172B_ABST
Patent Text Reader

Abstract

The present invention provides a method for designing and constructing a deep learning framework module for large-format remote sensing images. The present invention designs an intermediate layer representation and compilation optimization module of an intelligent model so that a general deep learning framework can integrate remote sensing characteristics and have the ability to intelligently interpret large-format remote sensing images. The specific process is as follows: the input intelligent processing model is processed by the large-format characteristics of the intermediate layer representation and compilation optimization module so that it has the ability to process large-format images. After the converted model is trained using image data, the parameters trained by the model with large-format characteristics are finally output. In addition, the present invention also designs a data segmentation parallel module for large-format remote sensing images, which is used to enhance the input large-format images through data, segment them along the H / W dimension, and send them to multiple training cards. After the present invention uses the intermediate layer representation and compilation optimization method for optimization, the framework has the ability to train and reason about large-format remote sensing images.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to a design and construction method of a large-format remote sensing image feature module in a deep learning framework, which is applied to integrating the intelligent interpretation capability of large-format remote sensing images at the framework level. Background Art

[0002] Since the ImageNet Challenge in 2012, deep neural network frameworks and models for general image processing have developed rapidly. At present, there are many open source deep learning frameworks. In China, the Institute of Computing Technology of the Chinese Academy of Sciences has launched the face recognition deep learning framework Dragon, Tsinghua University has released Jittor, and Internet companies such as Baidu, Huawei, Megstyle, and First-class Technology have successively open-sourced frameworks such as PaddlePaddle, MindSpore, MegEngine, and OneFlow. Abroad, the Montreal Institute of Technology opened up Theano, the University of Berkeley developed Caffe, and Japan's First Choice Network developed the then-leading Chainer framework. Google, Facebook, Amazon, etc. have successively opened up frameworks such as Tensorflow, PyTorch, and MxNet.

[0003] Although there are many general deep learning frameworks, each with its own advantages and disadvantages, the mainstream open source deep learning frameworks and models are mainly aimed at ordinary images, that is, ordinary small-format indoor / outdoor images. Compared with ordinary images, large format is a prominent feature of remote sensing images. Usually, the length and width (H*W) of a complete remote sensing image will be in the unit of 10,000, which is far beyond the processing limit of mainstream deep learning frameworks. In the field of remote sensing, image processing models are mainly obtained by migrating pre-trained models of ordinary images. The main technical means is to divide large-format remote sensing images into small-size tiles acceptable to deep learning frameworks for processing. However, image cropping and blocking will lead to insufficient pixel features at the edge of sample images. Even if the strategy of sample cropping with overlap and increasing the size of cropped samples is adopted, although it can be alleviated to a certain extent, the edge area is still involved in the training, and the negative impact on accuracy still exists. In order to solve the problem of information loss caused by block processing, the academic community has also conducted a lot of research, but it is basically concentrated at the model level, and the features required for large-format remote sensing image interpretation are not integrated from the framework level. Summary of the invention

[0004] In order to overcome the above problems, the present invention proposes a module design and construction method that embeds large-format remote sensing characteristics from the deep learning framework level. Aiming at the large-format characteristics of remote sensing images, automatic data segmentation, intermediate layer representation and compilation optimization methods are used to optimize the input image and model, so that the framework has the ability to train and reason about large-format remote sensing images.

[0005] The present invention provides a module design and construction method for embedding large-format remote sensing characteristics from the deep learning framework level. An intermediate representation module is designed to convert the model constructed by the multi-source framework into a model capable of processing large-format images through intermediate representation and compilation optimization. The specific construction method of the module includes the following steps:

[0006] First, the computational graph of the model built by the multi-source framework at the front end is compiled to generate an abstract syntax tree. Then, the intermediate representation module is used to transform the model into a large-scale remote sensing feature, and the machine execution code of the optimized model computational graph is generated. Finally, the model is trained based on the code, and the training process can use multi-device parallel computing.

[0007] The intermediate representation module is used to convert the model into a unified representation. The intermediate representation module adopts a multi-level hierarchical structure. The intermediate representation of each level retains the characteristics of a certain dimension of the model, so as to optimize the model in this dimension. The intermediate representation of each level can be converted to a lower level expression and perform optimization at the corresponding level. After intermediate representation and optimization at different levels, the optimized intermediate representation of the model is finally obtained; the intermediate representation module includes operator decomposition and operator fusion, wherein operator decomposition refers to decomposing the operators of the original large computer graph into a series of operators acting on a small calculation graph, so as to ensure that the entire model can be deployed on the target hardware; operator fusion refers to combining multiple operators together and putting them into the same core, so as to eliminate redundant calculations and reduce the memory or video memory occupancy of the calculation graph.

[0008] Furthermore, the intermediate representation adopts a graph data structure based on nodes and edges. A node represents an operation, an edge represents a value, each value is the result of an operation or a block parameter, and has a value type defined by the type checking system. All operations are contained in the block structure in order, blocks are contained in regions in order, and operations are allowed to contain regions, forming the overall hierarchical structure of the intermediate representation.

[0009] In the multi-level intermediate representation syntax, a data structure based on static single assignment SSA is used. The operation is the core of each expression. Each operator has its own identifier. The operator accepts input parameters and can also return parameters. The operator has attributes. The attributes need to be kept as constants during the compilation phase to inform the compiler of the basic information of the operator during the compilation phase.

[0010] A block is a list of operations. Each block represents a basic block of the compiler. The instructions in the block are executed in sequence, and the terminator operation is used to implement the control flow branch between basic blocks. The block uses a function-like method to represent the block parameter list. The block parameters are bound to the values ​​specified by the semantics of each operation. The block parameters of the entry block of the region are also the parameters of the region, bound to the parameters defined by the semantics of the operations contained. The block parameters of other blocks are determined by the semantics of the termination operation.

[0011] A region is an ordered list of blocks in an intermediate representation. There is no forced syntax in the intermediate representation. Instead, the inclusion operator is used to define the syntax within the region. Regions have no names or addresses, only the blocks contained in the region have them. Regions must be included in operations and have no types or attributes. The first block in a region is a special block called an "entry block", and the parameters of the entry block are also the parameters of the region itself.

[0012] Regions provide hierarchical encapsulation of programs: it is not possible to reference a block that is not in the same region as the reference source, i.e., the terminating operator; similarly, regions provide a natural scope for value visibility: values ​​defined in a region do not escape to the enclosing region; whether a value can be used by another operation in the same region depends on the type of region; an operation with a parent in the same region can use a value defined in a region if and only if the parent can use the value; values ​​defined by parameters of a region can always be used by any operation contained in the region; values ​​defined in a region can never be used outside the region;

[0013] Each value in the intermediate representation has a type defined by the type system. The type system is open, and there is no fixed list of types in the system.

[0014] The attribute mechanism is used in the intermediate representation to specify constant data for operations in locations where variables are not allowed. Each operation has an attribute dictionary that associates a set of attribute names with attribute values.

[0015] Furthermore, the specific meaning of the operator fusion is: creating a new operator Op, redefining the inputs, outputs, gradients, and weights of the Op, using the Op to replace the connected vertices of the shared logical region LogicalRegion, integrating the inputs, outputs, grads, and weights of the two vertices of the same edge into the new Op, and adding it to the computational graph Graph, thereby eliminating the calculation of redundant edges and reducing the memory or video memory usage of the Graph.

[0016] Furthermore, there are three types of operator fusion strategies: complex output reuse, mapping function and hiding. The operator fusion strategy is the fusion problem of the vertex V and edge E of the computation graph Graph = {V, E}, including vertex fusion and edge fusion;

[0017] Vertex fusion: Vertices V that share a logical region j , the connected input edge E in =(V i ,V j ) and output edge E out =(V j ,V k ), ablation vertex V j After that, a new edge E will be generated new =(V i ,V k ), the edge will be added to the new computational graph Graph;

[0018] Edge fusion: for the same output edges or input edges that share a logical region After eliminating redundant edges, new edges E will be generated ik =(V i ,V k ), side E ik The fused new edge will be added to the computational graph Graph.

[0019] Further, specifically, the edge and vertex fusion of the computation graph Graph includes the following steps;

[0020] ① Determine the relationship between the current node and the predecessor node, and traverse the nodes of the Graph V={V1,V2,…V N}, for the current node V m Input node Calculate and V m Pre-nodes {V0, V1, … V m-1}, that is, V m Whether it belongs to the predecessor node {V0, V1, ... V m-1}, to determine the starting traversal cursor start of step ②;

[0021] ②Search for the predecessor candidate node, compare the nodes between the current node and the predecessor cursor node, determine the predecessor node to be fused, and traverse V m Pre-nodes of the GPU device and logical partition parameters are consistent with V m Same; if they are the same, they are qualified candidate nodes V k ;

[0022] ③ Create the fusion node FusedOp and establish the predecessor node relationship, and then k As the initialization node of the newly created fusion node FusedOp, and update the inputs, outputs, grad, and weights of FusedOp to V k The corresponding inputs, outputs, grads, weights of the nodes, and the candidate nodes V k With the current processing node V m Check whether the logical areas occupied by the inputs, outputs, and weights are the same; if they are the same, update the index of the input type; otherwise, update the current processing node V m The inputs, outputs and weights are assigned to the corresponding parameters of FusedOp;

[0023] ④ Create the fusion node FusedOp and establish the relationship between the subsequent nodes, and create a new calculation graph Graph. For the new calculation graph Graph, first add the predecessor node of FusedOp to the new Graph, then add FuseOp to the new Graph, and traverse the node V in the original Graph. m The unprocessed successor nodes succeed_nodes{V m+1 ,V m+2 ,…V N}; If the following node V t If V is not involved in the calculation of the fusion operator, t Whether the input node belongs to V m , if it belongs to V m , then traverse the output of the FusedOp operator and connect it to the node V t The output with the same logic area in the input is assigned to the node V t input, and the node V t Add a new Graph;

[0024] ⑤ Repeat steps ① to ④ until the node V={V1,V2,…V N After the traversal is completed, the new computational graph Graph after operator fusion optimization can be obtained.

[0025] Furthermore, the operator fusion is run on one graphics card or multiple graphics cards. When the operator fusion is performed on multiple graphics cards, the following parallel strategy is adopted;

[0026] Assume that the computational graph Graph is represented by G c ={E c ,V c}, where V cis a collection of various operators, that is, a collection of computing nodes, E c is the set of connecting edges between nodes in the computation graph, and its computational cost is expressed as The connection diagram of the communication and storage between devices is represented by G d ={E d ,V d}, where V d It is a collection of various devices responsible for storage and computing, that is, a collection of device nodes. d is the set of edges connecting devices. Its computational cost, i.e., the latency and bandwidth communication cost of transmitting operators between devices and the cost of placing operators on devices in parallel, is expressed as: Then the distributed strategy optimization objective function of the optimal computation graph is:

[0027]

[0028] It adopts a multi-dimensional hybrid parallel strategy, uses the Legion parallel library as the underlying parallel framework driver, and integrates the remote sensing dimension characteristics to automatically iterate and optimize the objective function in formula (1) to find the optimal distributed parallel strategy for the computational graph on a given device.

[0029] The iterative optimization process uses reinforcement learning methods to optimize the device scheduling of operator calculations for large-scale deep learning model training. The input of the reinforcement learning model is the current model allocation strategy. The environment for reinforcement learning optimization is to train the network in the actual system according to the allocation strategy. The output of the model is the actual running time of the training network. In order to optimize the model, the method for calculating the error loss during training is to calculate the error loss through the output and a baseline result, and the allocation strategy is optimized and improved based on the obtained error loss and then input into the reinforcement learning system model again.

[0030] Furthermore, the operator decomposition specifically includes:

[0031] First, traverse each node of the model calculation graph, calculate the resource usage information of the node and determine whether the node can run on the target device. If a node that cannot be directly run on the target device is encountered, the node operator is decomposed: for the feature graph of the operator input, the original feature graph is cut into smaller feature graphs by cutting, and then the operators are applied to the cut feature graphs respectively, and the results are fused to obtain the original output. After operator decomposition, the single node in the original calculation graph branches into multiple nodes with smaller inputs.

[0032] Furthermore, for the convolution operator, the calculation formula of the operator decomposition is as follows;

[0033] For the convolution operator conv2d data,weight,strides,padding,kernel, the operator takes weight as the convolution kernel input and performs convolution operation with data. The calculation formula of the output tensor is as follows:

[0034]

[0035] Where b represents the batch of output tensors, c represents the number of channels, y represents the height, x represents the width, k represents the dimension of the input channel, stride represents the convolution step size, padding represents the padding size, kernel represents the convolution kernel size, and kernel[0] represents the 0th dimension of the convolution kernel;

[0036] The operator decomposition function R takes the convolution operator as input and outputs the decomposed model operator. Its calculation rules are as follows:

[0037]

[0038] Among them, conv2d data,weight,strides,padding,kernel The operator is replaced by M conv2ds that take the cut feature map as input and change the padding method data′,weight,strides,padding′,kernel , data′ represents the input of the operator after decomposition, padding′ represents the padding size of the operator after decomposition, M represents the number of blocks cut by the feature map; F represents the fusion function for fusing the decomposed convolution results, and its calculation process is:

[0039] F(T1,T2,axis)=(T1T2)

[0040] Where T represents the feature map tensor, TT represents the connection between two tensors along a certain axis, and axis represents the fused coordinate axis.

[0041] Furthermore, the deep learning framework module design and construction method for large-format remote sensing images also includes an image data segmentation parallel module, which is used to perform data enhancement, segmentation, and distribution of large-format images to multiple training cards;

[0042] The data enhancement is as follows: first, the prepared large-format remote sensing images and the corresponding annotation data are decoded to obtain training data with a shape of [H, W, C] and annotation data with a shape of [H, W], and geometric changes and color changes are performed on the decoded training data and annotation data, where the geometric changes include rotation and flipping, and the color changes include linear changes;

[0043] Data segmentation is as follows: data is segmented according to H and W dimensions. The number of segments is related to the memory usage during network execution and the maximum H and W specifications supported by the operator. During segmentation, the training and labeled data are segmented into a specified number of parts in H and W dimensions according to a fixed step size. When the data cannot be segmented completely, the redundant pixels can be discarded or filled with fixed pixel values.

[0044] The specific data distribution is as follows: a two-level data processing pipeline is implemented to distribute the segmented data blocks to multiple training cards at the same time; the main pipeline implements data enhancement and data segmentation operations, and the segmented data blocks serve as the input of the secondary data processing pipeline. The secondary pipeline is responsible for distributing the input data blocks to the designated training cards, and the existing data transmission limitations are circumvented by splitting the data processing pipeline.

[0045] Compared with the prior art, the advantages and beneficial effects of the present invention are as follows:

[0046] 1. The intermediate representation and optimization method of large-scale remote sensing images described in the present invention can be applied to any front-end framework;

[0047] 2. The present invention is modular in design and can be inserted into any general deep learning framework to enable it to have the ability to process and interpret large-scale remote sensing images. BRIEF DESCRIPTION OF THE DRAWINGS

[0048] Figure 1 A schematic diagram of multi-level intermediate representation and optimization;

[0049] Figure 2 It is a schematic diagram of multi-level intermediate representation;

[0050] Figure 3 is the hierarchy of intermediate representations;

[0051] Figure 4 The syntax format of the operation is shown below:

[0052] Figure 5 The syntax of the block is shown below:

[0053] Figure 6 Provides examples for branching, returning, and block parameters;

[0054] Figure 7 Quote range examples for area values;

[0055] Figure 8 is an example of an open type system;

[0056] Fig. 9 An example of an intermediate representation for the type system;

[0057] Fig.10 is an example of attribute syntax;

[0058] Fig.11 This is an example of a complete intermediate representation module;

[0059] Fig.12 It is the operator fusion strategy of TVM;

[0060] Fig.13 This is the schematic diagram of IR before fusion;

[0061] Fig.14 This is a schematic diagram of IR after fusion;

[0062] Fig.15 There are two operator fusion strategies adopted in the present invention, (a) is node fusion, and (b) is edge fusion;

[0063] Fig.16 To determine the current node V m Schematic diagram of the relationship with the predecessor node;

[0064] Fig.17 Find the schematic for the predecessor node;

[0065] Fig.18 Create a schematic diagram for the fusion node FusedOp;

[0066] Fig.19 Find the schematic for the rear drive node;

[0067] Fig. 20 A diagram showing the common types of devices that affect the computational graph.

[0068] Fig.21 Schematic diagram of the model assigned using reinforcement learning;

[0069] Fig. 22 Decomposition algorithm diagram for operators;

[0070] Fig.23 Decompose the computational graphs before and after the optimization for the operator;

[0071] Fig.24 This is a schematic diagram of the decomposition mode of the Conv2d operator;

[0072] Fig.25 Schematic diagram of equivalent results of operator decomposition;

[0073] Fig.26 It is a parallel schematic diagram of data interaction between adjacent devices;

[0074] Fig. 27 This is a flow chart for processing convolution operators;

[0075] Fig.28 This is a schematic diagram of the structure of remote sensing image enhancement, segmentation and multi-channel decentralization performed by module 2 in this embodiment. DETAILED DESCRIPTION

[0076] In order to better understand the technical solution of the present invention, the technical solution of the present invention will be described in detail below in combination with the accompanying drawings, technical principles and embodiments.

[0077] The present invention designs a data enhancement, segmentation and distribution module for large-format remote sensing images and an intermediate layer representation and compilation optimization module for the model so that the general deep learning framework integrates remote sensing characteristics and has the intelligent interpretation capability of large-format remote sensing images. The specific process is as follows: the input large-format image is data enhanced, segmented along the H / W dimension, and distributed to multiple training cards. At the same time, the input intelligent processing model (such as FCN, etc.) is processed by the large-format characteristics of the intermediate layer representation and compilation optimization module so that it has the ability to process large-format images. After the converted model is trained using the processed image data, the parameters trained by the model with large-format characteristics are finally output.

[0078] Based on the technical principles of these modules, the present invention provides specific embodiments for illustration. The specific implementation method is as follows:

[0079] Module 1. Intermediate layer representation and compilation optimization of large-scale remote sensing image operators

[0080] 1.1 General Overview

[0081] The flowchart of this module is as follows Figure 1 As shown. The computational graph of the model built by the front-end using a multi-source framework (such as pytorch, tensorflow, etc.) is compiled to generate an abstract syntax tree, and then the multi-level intermediate representation uses strategies such as operator fusion and operator decomposition to transform the model's large-scale remote sensing characteristics, generate the machine execution code of the optimized model computation graph, and finally train the model based on the code. The training process can use multi-device parallel computing. This module is the intermediate layer representation and compilation optimization part. The aforementioned abstract syntax tree compilation part is not a patent application content and will not be elaborated.

[0082] Recursively traverse the input abstract syntax tree and generate the intermediate representation of the model according to the predefined core IR definition set. The intermediate representation adopts a multi-level hierarchical structure. The intermediate representation of each level retains the characteristics of a certain dimension of the model, so as to optimize the model in this dimension. The intermediate representation of each level can be converted to a lower level expression and perform optimization at the corresponding level. After intermediate representation and optimization at different levels, the optimized intermediate representation of the model is finally obtained. This hierarchical intermediate representation ensures that the optimization at each level will not be repeated and reused, which improves the ease of use and extensibility of the framework. The specific design of the multi-level intermediate representation is as follows: Figure 2 .

[0083] Compared with ordinary AI compilers, the remote sensing intermediate representation level is added, and operator decomposition optimization is added according to the characteristics of the remote sensing field. The IR stage retains the high-level expression of operators, and decomposes the original operators acting on the large graph into a series of operators acting on the small graph, so as to ensure that the entire model can be deployed on the target hardware (see 1.3 for details). In the GraphIR stage, common optimization methods for deep learning calculation graphs are performed, such as operator fusion (see 1.2 for details), etc., to optimize the model calculation graph. The operators in this stage are still in a higher-level operator expression form. The third-level intermediate representation Loop IR performs optimization and conversion for loop operations in conventional compilers, including loop unrolling, loop slicing, etc. At this stage, some operators have been reduced to lower-level operations. The last stage needs to convert the IR accordingly according to the target platform for deployment, and perform optimization based on the hardware platform, such as memory allocation between the host and the device. These four stages can be optimized separately or in combination. Among them, the third and fourth-level intermediate representations are not the main innovations of the present invention, and the present invention will not be described.

[0084] The intermediate representation uses a graph data structure based on nodes (operations) and edges (values). Each value is the result of an operation or block parameter and has a value type defined by the type checking system. All operations are contained in the block structure in order, blocks are contained in regions in order, and operations are allowed to contain regions, forming the overall hierarchical structure of the intermediate representation, such as Figure 3 As shown:

[0085] In the multi-level intermediate representation syntax, the data structure based on SSA (static single assignment) is adopted. The operation is the core of each expression. The operation can represent many different concepts, from higher-level concepts (such as function definition, function call, buffer allocation, buffer slice and process creation) to lower-level concepts (such as target-independent arithmetic operations, configuration registers) and logic gates. Each operator has its own identifier. The operator accepts input parameters and can also return parameters. The operator has attributes. The attributes need to be kept as constants during the compilation stage to inform the compiler of the basic information of the operator during the compilation stage. The specific syntax format of the operation is as follows: Figure 4 ;

[0086] A block is a list of operations. Each block represents a basic block of the compiler. The instructions in the block are executed in sequence, and terminator operations are used to implement control flow branches between basic blocks. The syntax of a block is as follows: Figure 5 shown.

[0087] Blocks are represented in a function-like manner as lists of block parameters. Block parameters are bound to values ​​specified by the semantics of the respective operation. The block parameters of the entry block of a region are also parameters of the region, bound to the parameters defined by the semantics of the contained operations. The block parameters of other blocks are determined by the semantics of the terminating operation (e.g., a branch operation is followed by a successor block). Figure 6 Shows examples involving branching, returns, and block parameters.

[0088] A region is an ordered list of blocks in an intermediate representation. There is no syntax imposed on regions in the intermediate representation. Instead, the syntax within a region is defined using the containment operator. Regions do not have names or addresses, only the blocks contained in the region do. Regions must be included in an operation and have no type or attributes. The first block in a region is a special block called an "entry block". The parameters of the entry block are also the parameters of the region itself. The syntax of a region is as follows:

[0089] Region::=`{`Block*`}`

[0090] Regions provide hierarchical encapsulation of programs: it is not possible to reference (i.e. branch to) a block that is not in the same region as the reference source (i.e. terminating operator). Similarly, regions provide a natural scope for visibility of values: values ​​defined in a region do not escape to the enclosing region. Whether a value can be used by another operation in the same region depends on the type of region. An operation with a parent in the same region can use a value defined in a region if and only if the parent can use that value. Values ​​defined by parameters of a region are always usable by any operation contained in that region. Values ​​defined in a region can never be used outside of that region. Figure 7 A specific example is given.

[0091] Each value in the intermediate representation has a type defined by the type system. The type system is open, and there is no fixed list of types in the system. Its syntax is as follows Figure 8 .

[0092] Using a concrete intermediate representation of the type system such as Fig. 9 .

[0093] The attribute mechanism is used in the intermediate representation to specify constant data for operations in locations where variables are not allowed. Each operation has an attribute dictionary that associates a set of attribute names with attribute values. The syntax of an attribute is as follows: Fig.10 .

[0094] Finally, a complete intermediate representation module example is as follows Fig.11 .

[0095] 1.2 Operator Fusion and Parallelism

[0096] 1.2.1 Operator Fusion Strategy in Computational Graph

[0097] The meaning of operator fusion is: create a new operator Op, redefine the inputs, outputs, gradients, weights, etc. of the Op, use the Op to replace the connected vertices that share the Logical Region, integrate the inputs, outputs, grads, and weights of the two vertices on the same edge into the new Op, and add it to the computational graph Graph, thereby eliminating the calculation of redundant edges and reducing the memory / video memory usage of the Graph. In the TVM framework, operator fusion strategies are divided into three types: complex-out-fusable, which is more complex to calculate, such as convolution; mapping functions (injective), such as addition, dot multiplication, etc.; reduction, which has a dimensionality reduction property from input to output, such as sum; opaque, which is an operator that cannot be fused, such as sort. Fig.12 shown.

[0098] For the above three situations, operator fusion can be performed to reduce data storage and reading operations, thereby reducing the network running time:

[0099] complex-out->injective - for example, relu activation after convolution

[0100] injective->injective - for example, perform addition first and then perform square root operation

[0101] injective->reduction - for example, taking the logarithm first and then summing

[0102] If any of the following three situations occurs during the fusion process, the fusion will not be performed:

[0103] The operator type is kOpaque, which means it cannot be fused;

[0104] The node does not have a dominant point. A dominant point is a point in a graph starting from s. If there is a point t such that after deleting t, there is no path from s to point w, which does not include point w itself, then t is called the dominant point of w.

[0105] The number of nodes that can be merged exceeds a certain limit;

[0106] At the same time, you can also make specific judgments on the operators, such as current.op_type == "add" && next.op_type == "mul", to decide whether to fuse. This also means that you can add proprietary fusion rules based on remote sensing characteristics through similar specific judgments, or similar to the above category judgments. By executing the corresponding pass to make judgments, you can complete the custom operator fusion operation. After the fusion process is completed, a new calculation graph is created.

[0107] 1.2.2 Fusion Example

[0108] Consider the simple operation z = exp(x + 1), the code is as follows:

[0109] x=var("x",shape=(10,20))

[0110] y=add(x,const(1,"float32"))

[0111] z=exp(y)

[0112] It is judged that it meets the second fusion rule. Before the fusion operation, its IR is as follows Fig.13 As shown: x% is the input value x; 0% defines the addition operation, and the return value is 1%; 2% corresponds to y; 3% defines the exp operation, and the return value is 4%; 5% corresponds to the final return value z.

[0113] After the fusion operation, the IR obtained is as follows Fig.14 As shown: x% is the input value x; 0% defines the addition and exp operations, 1% is the intermediate value obtained by the addition operation, and the final return value is 2%; 3% corresponds to the final return value z.

[0114] It can be seen from the fused IR that addition and exp are fused into one operator, which saves one data storage and reading operation, and the final calculation result does not change. This invention draws on the three existing manually defined fusion methods of TVM, but the difference is that the strategy of operator fusion is simplified to the fusion problem of the vertex V and edge E that constitute the calculation graph Graph = {V, E}. Fig.15 shown.

[0115] Vertex Fusion. For vertices that share a logical region, such as the vertex V in the figure j , the connected input edge E in =(V i ,V j ) and output edge E out =(V j ,V k), ablation vertex V j After that, a new edge E will be generated new =(V i ,V k ), the edge will be added to the new computational graph Graph.

[0116] Edge Fusion. For the same output edge or input edge that shares a logical region After eliminating redundant edges, new edges E will be generated ik =(V i ,V k ), side E ik The fused new edge is added to the computational graph Graph. Specifically, the edge and vertex fusion of the computational graph Graph includes the following steps:

[0117] ⑥ Determine the relationship between the current node and the predecessor node. Traverse the nodes of the Graph V={V1,V2,…V N}, for the current node V m Input node Calculate and V m Pre-nodes {V0, V1, … V m-1}, that is, V m Whether it belongs to the predecessor node {V0, V1, ... V m-1}. This is used to determine the starting traversal cursor start of step ②. This step is as follows Fig.16 shown.

[0118] ⑦Search for candidate predecessor nodes. Compare the nodes between the current node and the predecessor cursor node to determine the predecessor node to be fused. Traverse V m Pre-nodes of the GPU device and logical partitions to determine whether they are consistent with V m If they are the same, they are candidate nodes that meet the conditions. k This step is as follows Fig.17 .

[0119] ⑧ Create the fusion node FusedOp and establish the predecessor node relationship. k As the initialization node of the newly created fusion node FusedOp, and update the inputs, outputs, grad, and weights of FusedOp to V k The corresponding inputs, outputs, grads, and weights of the nodes. At the same time, compare the candidate nodes V k With the current processing node V mCheck whether the logical areas occupied by the inputs, outputs, and weights are the same. If they are the same, update the index of the input type; otherwise, update the current processing node V m The inputs, outputs and weights of FusedOp are assigned to the corresponding parameters. Fig.18 shown.

[0120] ⑨ Create the fusion node FusedOp and establish the relationship between the successor nodes, and create a new calculation graph Graph. For the new calculation graph Graph, first add the predecessor node of FusedOp to the new Graph, then add FuseOp to the new Graph, and traverse the node V in the original Graph. m The unprocessed successor nodes succeed_nodes{V m+1 ,V m+2 ,…V N}. If the following node V t If V is not involved in the calculation of the fusion operator, t Whether the input node belongs to V m If it belongs to V m , then traverse the output of the FusedOp operator and connect it to the node V t The output with the same logic area in the input is assigned to the node V t input, and the node V t Add a new Graph. The processing process of the downstream node is as follows Fig.19 .

[0121] ⑩ Repeat steps ① to ④ until the node V={V1,V2,…V N After the traversal is completed, the new computational graph Graph after operator fusion optimization can be obtained.

[0122] 1.2.3 Parallel Strategy for Computing Graph

[0123] The main factors affecting the parallelism of the computational graph include: the transmission bandwidth (band width) and latency (latency) between devices, the computational amount of operator forward propagation and backward propagation, etc. Fig. 20 As shown, the types of equipment involved in the present invention include:

[0124] 1) Devices responsible for computing, such as CPU, GPU, etc.

[0125] 2) Devices responsible for storage, such as DRAM, Zero-Copy, GPU Framebuffer, etc.

[0126] 3) Devices responsible for communication, such as Memory bus, InteI UPI I / O, PCIe, NV-Link, etc.

[0127] Assume that the computational graph Graph is represented by G c ={E c ,V c}, where V c is a collection of various operators, that is, a collection of computing nodes, E c is the set of connecting edges between nodes in the computation graph, and its computational cost (such as the number of operator parameters such as Conv) is expressed as The connection diagram of the communication and storage between devices is represented by G d ={E d ,V d}, where V d It is a collection of various devices responsible for storage and computing, that is, a collection of device nodes. d is the set of edges connecting devices, and its computational cost (the latency and bandwidth communication cost of transmitting operators between devices, and the cost of placing operators on devices according to the parallel strategy) is expressed as: Then the distributed strategy optimization objective function of the optimal computation graph is:

[0128]

[0129] The parameters involved in the distributed strategy include:

[0130] Device type, such as CPU / GPU, etc.

[0131] The number of splits in each dimension of the multidimensional Tensor;

[0132] Dimension information of multidimensional Tensor

[0133] Distributed device ID information

[0134] The present invention adopts a multi-dimensional hybrid parallel strategy, uses the Legion parallel library as the underlying parallel framework driver, and integrates the remote sensing dimension characteristics to automatically iterate and optimize the objective function in formula (1) to find the optimal distributed parallel strategy for the computational graph on a given device. The iterative optimization process uses the reinforcement learning method to optimize the device scheduling of operator calculations for large-scale deep learning model training. The process of this method is as follows Fig.21As shown in the figure. The input of the reinforcement learning model is the current model allocation strategy. The environment for reinforcement learning optimization is to train the network in the actual system according to the allocation strategy. The output of the model is the actual running time of the training network. In order to optimize the model, the method for calculating the error loss during training is to calculate the error loss by the output and a baseline result, and then optimize the allocation strategy based on the error loss and input it into the reinforcement learning system model again.

[0135] 1.3 Operator Decomposition and Optimization

[0136] In view of the large size of remote sensing images, operator decomposition optimization is added to the intermediate representation of the model. First, traverse each node of the model calculation graph, calculate the resource usage information of the node and determine whether the node can run on the target device. If a node that cannot be run directly on the target device is encountered, the operator of the node is decomposed: for the feature map of the operator input, the original feature map is cut into smaller feature maps by cutting, and then the operators are applied to the cut feature maps respectively, and the results are fused to obtain the original output. After operator decomposition, the single node in the original calculation graph branches into multiple nodes with smaller inputs, and the calculation process continues to be executed backward. Fig. 22 The specific details of the operator decomposition algorithm are presented.

[0137] The calculation diagram before and after optimization is as follows Fig.23 shown.

[0138] The computational graphs obtained before and after optimization are equivalent, but the computing nodes that originally occupied large resources are decomposed into several computing nodes with smaller resource usage. The entire algorithm is recursive, because the optimized nodes will also be added to the computational graph to continue to perform operator decomposition optimization until the resources occupied by each node are finally less than the resource limit on the target device, so that the optimized computational graph can run on the target device, solving the problem of large image size in the remote sensing field.

[0139] The core purpose of operator decomposition is to decompose the calculation originally on the large input feature map into the calculation on several small input feature maps. The calculated result is consistent with the original calculation result without operator decomposition after simple splicing operation. This decomposition allows the GPU to perform calculations only on the decomposed small input feature map each time, thereby reducing the requirements for video memory. The intermediate results after calculation are stored in the memory and used as the input feature map for the next layer of operator calculation. Obviously, this operator decomposition method requires different operator decomposition strategies for different operators to ensure the consistency of the calculation results before and after operator decomposition.

[0140] In the experiment, we used the Conv2d operator, which is the most commonly used and most complex operator in deep learning, to perform operator decomposition tests. Fig.24The operator decomposition pattern of the Conv2d operator is shown:

[0141] The figure above shows the decomposition mode with 2 decomposition blocks under the one-dimensional cutting method. For the convolution operator, the convolution kernel needs to slide and calculate on the feature map during the calculation process, and the calculation results are stored in the corresponding positions of the output feature map in sequence. Therefore, in order to ensure that the calculation results can be directly spliced ​​into the original calculation results without operator decomposition, when cutting the input feature map, it is necessary to allow the two small feature map inputs to overlap. The length of this part can be calculated by the parameters of the convolution operator, so that the boundary position of the sliding window on the two small feature maps after decomposition is exactly equal to the two adjacent calculations of the cut position on the original input feature map. After that, the convolution operation is performed on the decomposed small feature maps according to the parameters of the original convolution operator, and finally the calculation results are spliced ​​along the axis direction of the cutting, so that the calculation process after decomposition is actually completely equivalent to the original calculation process. In the two-dimensional cutting method, only one more cutting dimension needs to be considered.

[0142] The calculation formula of operator decomposition is as follows:

[0143] For the convolution operator conv2d data,weight,strides,padding,kernel , the operator takes weight as the convolution kernel input and performs convolution operation with data. The calculation formula of the output tensor is as follows:

[0144]

[0145] Where b represents the batch of output tensors, c represents the number of channels, y represents the height, x represents the width, k represents the dimension of the input channel, stride represents the convolution step size, padding represents the padding size, kernel represents the convolution kernel size, and kernel[0] represents the 0th dimension of the convolution kernel.

[0146] The operator decomposition function R takes the convolution operator as input and outputs the decomposed model operator. Its calculation rules are as follows:

[0147]

[0148] Among them, conv2d data,weight,strides,padding,kernel The operator is replaced by M conv2ds that take the cut feature map as input and change the padding method data′,weight,strides,padding′,kernel , data′ represents the input of the operator after decomposition, padding′ represents the padding size of the operator after decomposition, M represents the number of blocks cut by the feature map; F represents the fusion function for fusing the decomposed convolution results, and its calculation process is:

[0149] F(T1,T2,axis)=(T1T2)

[0150] Where T represents the feature map tensor, TT represents the connection between two tensors along a certain axis, and axis represents the fused coordinate axis.

[0151] The intermediate expression can be expressed as the following transformation:

[0152] %1=conv2d(%input,%weight,stride=stride_size,kernel=kernel_size,padding

[0153] =padding_size)

[0154] %2.1=strided_slice(%input,begin,end)

[0155] %2.2=strided_slice(%input,begin,end)

[0156] %3.1=conv2d(%2.1,%weight,stride=stride_size,kernel=kernel_size,padding

[0157] =padding_size)

[0158] %3.2=conv2d(%2.2,%weight,stride=stride_size,kernel=kernel_size,padding

[0159] =padding_size)

[0160] 4%=concatenate(%3.1,%3.2)

[0161] Among them, the strided_slice operator represents the cutting operation on the input matrix, and the concatenate operator represents the concatenation operation of two matrices along a certain coordinate axis.

[0162] In the experiment, the above operator decomposition strategy is used to conduct experiments on randomly generated data of different sizes for the conv2d operator. The experimental results are as follows: Fig.25 As shown, the calculation results obtained before and after the operator decomposition (the tensors shown in the figure as original and optimized) can be considered equal within the allowable error range.

[0163] 1.4 Collaboratively complete distributed parallel computing of operators such as convolution across multiple devices

[0164] 1.4.1 Identify operators that need to obtain peripheral device data

[0165] For convolution operators, after the input data is split and distributed to multiple devices, each device needs to obtain the missing data (Overlap) from the adjacent device when performing convolution calculations. Fig.26 shown.

[0166] 1.4.2 Adjust the network structure to ensure that the network semantics remain unchanged

[0167] For convolution operators (including convolution, pooling, deconvolution, etc.), the following processing is performed ( Fig. 27 ):

[0168] 1. Extract the overlapped part from the original input data of the convolution (for example, using operators such as Slice / Split).

[0169] 2. Exchange overlap data between adjacent devices (for example, using operators such as HcomAlltoAllv).

[0170] 3. Each device concatenates the local data with the received overlap data and adjusts attributes such as padding according to the pad mode, and uses the adjusted data and attributes for convolution calculation.

[0171] 1.5 Call the self-developed operator library to generate executable code for the target platform

[0172] After multi-level intermediate representation conversion and optimization, all basic operations will be converted into the form of system basic operators, and then through registration, the system basic operators will call the back-end operator implementation, implement the underlying operator operations through C++, and call the system compiler to compile it into a dynamic library for the code generation module to call.

[0173] In addition, the present invention also designs a large-format remote sensing image data segmentation parallel module, which is used to enhance the input large-format image data, segment it along the H / W dimension, and send it to multiple training cards;

[0174] Based on the technical principles of these modules, the present invention provides specific embodiments for illustration. The specific implementation method is as follows:

[0175] Module 2. Enhance, segment and distribute large-scale remote sensing images

[0176] 2.1 Large-scale remote sensing image decoding and data enhancement

[0177] First, you need to prepare large-scale remote sensing images and corresponding annotation data. Through decoding operations, you can get training data with a shape of [H, W, C] and annotation data with a shape of [H, W]. Perform geometric changes such as rotation and flipping and color changes such as linear changes on the decoded training data and annotation data. Note: Do not perform data augmentation operations such as cropping and scaling to change the image size on the training data or annotation data.

[0178] 2.2 Data H / W Segmentation

[0179] The C dimension of large-format remote sensing images is very small, generally four bands of R / G / B / near infrared, and the H and W dimensions are relatively large. The present invention divides the data according to the H and W dimensions, and the number of divisions is related to the memory usage during network execution and the maximum specifications of H and W supported by the operator. When dividing, the training and annotated data are divided into a specified number of parts in the H and W dimensions according to a fixed step size. When the division cannot be completed, you can choose to discard the redundant pixels or fill them with fixed pixel values.

[0180] 2.3 Multi-channel delivery

[0181] Currently, data transmission is limited to one data processing pipeline that can only send data to one card through a transmission link. The present invention implements a two-level data processing pipeline mode, and sends the divided data blocks to multiple training cards at the same time.

[0182] Fig.28 The structure involved is briefly illustrated in Figure 1, which includes the main and secondary data processing pipelines. The main pipeline implements the data enhancement and data segmentation operations in steps 2.1 and 2.2. The segmented data blocks are used as the input of the secondary data processing pipeline, which is responsible for sending the input data blocks to the specified training card. The existing data transmission limitations can be circumvented by splitting the data processing pipeline.

[0183] In specific implementation, the present invention can use computer software technology to realize automatic operation process, and the device that runs the process of the present invention should also be within the scope of protection.

[0184] The specific embodiments described herein are merely examples of the spirit of the present invention. Those skilled in the art may make various modifications or additions to the specific embodiments described or replace them in similar ways, but they will not deviate from the spirit of the present invention or exceed the scope defined by the appended claims.

Claims

1. Design and construction method of deep learning framework module for large-scale remote sensing images, characterized by: An intermediate representation module is designed to convert the model built by the multi-source framework into a model capable of processing large-format images through intermediate representation and compilation optimization. The specific construction method of this module includes the following steps: First, the computational graph of the model built by the multi-source framework at the front end is compiled to generate an abstract syntax tree. Then, the intermediate representation module is used to transform the model into a large-scale remote sensing feature, and the machine execution code of the optimized model computational graph is generated. Finally, the model is trained based on the code, and the training process can use multi-device parallel computing. The intermediate representation module is used to convert the model into a unified representation. The intermediate representation module adopts a multi-level hierarchical structure. The intermediate representation of each level retains the characteristics of a certain dimension of the model, so as to optimize the model in this dimension. The intermediate representation of each level can be converted to a lower level expression and perform optimization at the corresponding level. After intermediate representation and optimization at different levels, the optimized intermediate representation of the model is finally obtained; the intermediate representation module includes operator decomposition and operator fusion, wherein operator decomposition refers to decomposing the operators of the original large computer graph into a series of operators acting on a small calculation graph, so as to ensure that the entire model can be deployed on the target hardware; operator fusion refers to combining multiple operators together and putting them into the same core, so as to eliminate redundant calculations and reduce the memory or video memory occupancy of the calculation graph.

2. The method for designing and constructing a deep learning framework module for large-scale remote sensing images according to claim 1, characterized in that: The intermediate representation uses a graph data structure based on nodes and edges. A node represents an operation, and an edge represents a value. Each value is the result of an operation or a block parameter and has a value type defined by the type checking system. All operations are contained in the block structure in order, and blocks are contained in regions in order. Operations are allowed to contain regions, which constitute the overall hierarchical structure of the intermediate representation. In the multi-level intermediate representation syntax, a data structure based on static single assignment SSA is used. The operation is the core of each expression. Each operator has its own identifier. The operator accepts input parameters and can also return parameters. The operator has attributes. The attributes need to be kept as constants during the compilation phase to inform the compiler of the basic information of the operator during the compilation phase. A block is a list of operations. Each block represents a basic block of the compiler. The instructions in the block are executed in sequence, and terminator operations are used to implement control flow branches between basic blocks. The block uses a function-like way to represent the block parameter list. The block parameters are bound to the values ​​specified by the semantics of each operation. The block parameters of the entry block of a region are also the parameters of the region, bound to the parameters defined by the semantics of the contained operations. The block parameters of other blocks are determined by the semantics of the terminal operation. A region is an ordered list of blocks in the intermediate representation. There is no forced syntax in the intermediate representation. Instead, the syntax in the region is defined using the inclusion operator. Regions have no name or address, only the blocks contained in the region have. Regions must be included in the operation and have no type or attributes. The first block in the region is a special block called the "entry block". The parameters of the entry block are also the parameters of the region itself. Regions provide hierarchical encapsulation of programs: it is not possible to reference a block that is not in the same region as the reference source, i.e., the terminating operator; similarly, regions provide a natural scope for value visibility: values ​​defined in a region do not escape to the enclosing region; whether a value can be used by another operation in the same region depends on the type of region; an operation with a parent in the same region can use a value defined in a region if and only if the parent can use the value; values ​​defined by parameters of a region can always be used by any operation contained in the region; values ​​defined in a region can never be used outside the region; Each value in the intermediate representation has a type defined by the type system. The type system is open, and there is no fixed list of types in the system. The attribute mechanism is used in the intermediate representation to specify constant data for operations in locations where variables are not allowed. Each operation has an attribute dictionary that associates a set of attribute names with attribute values.

3. The method for designing and constructing a deep learning framework module for large-scale remote sensing images according to claim 1, characterized in that: The specific meaning of the operator fusion is: creating a new operator Op, redefining the inputs, outputs, gradients, and weights of the Op, using the Op to replace the connected vertices of the shared logical region, integrating the inputs, outputs, grads, and weights of the two vertices of the same edge into the new Op, and adding it to the computational graph Graph, thereby eliminating the calculation of redundant edges and reducing the memory or video memory usage of the Graph.

4. The method for designing and constructing a deep learning framework module for large-scale remote sensing images according to claim 1, characterized in that: There are three types of operator fusion strategies: complex output reuse, mapping function and hiding. The operator fusion strategy is the fusion problem of vertex V and edge E of the computation graph Graph = {V, E}, including vertex fusion and edge fusion; Vertex fusion: Vertices V that share a logical region j , the connected input edge E in =(V i , V j ) and output edge E out =(V j , V k ), ablation vertex V j After that, a new edge E will be generated new =(V i , V k ), the edge will be added to the new computational graph Graph; Edge fusion: for the same output edges or input edges that share a logical region After eliminating redundant edges, new edges E will be generated ik =(V i , V k ), side E ik The fused new edge will be added to the computational graph Graph.

5. The method for designing and constructing a deep learning framework module for large-scale remote sensing images as claimed in claim 4, characterized in that: Specifically, the edge and vertex fusion of the computational graph Graph includes the following steps: ① Determine the relationship between the current node and the predecessor node, and traverse the nodes of the Graph V={V1,V2,...V N }, for the current node V m Input node Calculate and V m Pre-nodes {V0, V1, ... V m-1 }, that is, V m Whether it belongs to the predecessor node {V0, V1, ...V m-1 }, to determine the starting traversal cursor start of step ②; ②Search for the predecessor candidate node, compare the nodes between the current node and the predecessor cursor node, determine the predecessor node to be fused, and traverse V m Pre-nodes of the GPU device and logical partition parameters are consistent with V m Same; if they are the same, they are qualified candidate nodes V k ; ③ Create the fusion node FusedOp and establish the predecessor node relationship, and then k As the initialization node of the newly created fusion node FusedOp, and update the inputs, outputs, grad, and weights of FusedOp to V k The corresponding inputs, outputs, grads, weights of the nodes, and the candidate nodes V k With the current processing node V m Check whether the logical areas occupied by the inputs, outputs, and weights are the same; if they are the same, update the index of the input type; otherwise, update the current processing node V m The inputs, outputs and weights are assigned to the corresponding parameters of FusedOp; ④ Create the fusion node FusedOp and establish the relationship between the subsequent nodes, and create a new calculation graph Graph. For the new calculation graph Graph, first add the predecessor node of FusedOp to the new Graph, then add FuseOp to the new Graph, and traverse the node V in the original Graph. m The unprocessed successor nodes succeed_nodes{V m+1 , V m+2 , ... V N }; If the following node V t If V is not involved in the calculation of the fusion operator, t Whether the input node belongs to V m , if it belongs to V m , then traverse the output of the FusedOp operator and connect it to the node V t The output with the same logic area in the input is assigned to the node V t input, and the node V t Add a new Graph; ⑤ Repeat steps ① to ④ until the node V={V1,V2,...V N After the traversal is completed, the new computational graph Graph after operator fusion optimization can be obtained.

6. The method for designing and constructing a deep learning framework module for large-scale remote sensing images according to claim 1, characterized in that: The operator fusion is run on one graphics card or multiple graphics cards. When the operator fusion is performed on multiple graphics cards, the following parallel strategy is adopted; Assume that the computational graph Graph is represented by G c ={E c , V c }, where V c is a collection of various operators, that is, a collection of computing nodes, E c is the set of connecting edges between nodes in the computation graph, and its computational cost is expressed as The connection diagram of the communication and storage between devices is represented by G d ={E d , V d }, where V d It is a collection of various devices responsible for storage and computing, that is, a collection of device nodes. d is the set of connecting edges between devices. Its computational cost, i.e., the latency and bandwidth communication cost of transmitting operators between devices and the cost of placing operators on devices according to the parallel strategy, is expressed as: Then the distributed strategy optimization objective function of the optimal computation graph is: A multi-dimensional hybrid parallel strategy is adopted, the Legion parallel library is used as the underlying parallel framework driver, and the remote sensing dimension characteristics are integrated to automatically iterate and optimize the objective function in formula (1) to find the optimal distributed parallel strategy for the computational graph on a given device.

7. The method for designing and constructing a deep learning framework module for large-scale remote sensing images according to claim 6, characterized in that: In the process of iteratively optimizing the objective function in formula (1), the reinforcement learning method is used to optimize the device scheduling of operator calculations in large-scale deep learning model training. The input of the reinforcement learning model is the current model allocation strategy. The environment optimized by the reinforcement learning is to train the network in the actual system according to the allocation strategy. The output of the reinforcement learning model is the actual running time of the training network. In order to optimize the reinforcement learning model, the method of calculating the error loss during training is to calculate the error loss by output and a baseline result, and the allocation strategy is optimized and improved according to the obtained error loss and then input into the reinforcement learning model again.

8. The method for designing and constructing a deep learning framework module for large-scale remote sensing images according to claim 1, characterized in that: Operator decomposition specifically includes: First, traverse each node of the model calculation graph, calculate the resource usage information of the node and determine whether the node can run on the target device. If a node that cannot be directly run on the target device is encountered, the node operator is decomposed: for the feature graph of the operator input, the original feature graph is cut into smaller feature graphs by cutting, and then the operators are applied to the cut feature graphs respectively, and the results are fused to obtain the original output. After operator decomposition, the single node in the original calculation graph branches into multiple nodes with smaller inputs.

9. The method for designing and constructing a deep learning framework module for large-scale remote sensing images according to claim 8, characterized in that: For the convolution operator, the calculation formula of operator decomposition is as follows; For the convolution operator conv2d data,weight,strides,padding,kernel , the operator uses weight as the convolution kernel input and performs convolution operation with data. The calculation formula of the output tensor is as follows: Where b represents the batch of output tensors, c represents the number of channels, y represents the height, x represents the width, k represents the dimension of the input channel, stride represents the convolution step size, padding represents the padding size, kernel represents the convolution kernel size, and kernel[0] represents the 0th dimension of the convolution kernel; The operator decomposition function R takes the convolution operator as input and outputs the decomposed model operator. Its calculation rules are as follows: Among them, conv2d data,weight,strides,padding,kernel The operator is replaced by M conv2ds that take the cut feature map as input and change the padding method data′,weight,strides,padding′,kernel , data′ represents the input of the operator after decomposition, padding′ represents the padding size of the operator after decomposition, M represents the number of blocks cut by the feature map; F represents the fusion function for fusing the decomposed convolution results, and its calculation process is: F(T1, T2, axis) = (T1T2) Where T represents the feature map tensor, TT represents that two tensors are connected along a certain axis, and axis represents the fused coordinate axis.

10. The method for designing and constructing a deep learning framework module for large-scale remote sensing images according to claim 1, characterized in that: It also includes an image data segmentation parallel module, which is used to perform data enhancement, segmentation, and distribution of large-format images to multiple training cards; The data enhancement is as follows: first, the prepared large-format remote sensing images and the corresponding annotation data are decoded to obtain training data with a shape of [H, W, C] and annotation data with a shape of [H, W], and geometric changes and color changes are performed on the decoded training data and annotation data, where the geometric changes include rotation and flipping, and the color changes include linear changes; Data segmentation is as follows: data is segmented according to H and W dimensions. The number of segments is related to the memory usage during network execution and the maximum H and W specifications supported by the operator. During segmentation, the training and labeled data are segmented into a specified number of parts in H and W dimensions according to a fixed step size. When the data cannot be segmented completely, the redundant pixels can be discarded or filled with fixed pixel values. The specific data distribution is as follows: a two-level data processing pipeline is implemented to distribute the segmented data blocks to multiple training cards at the same time; the main pipeline implements data enhancement and data segmentation operations, and the segmented data blocks serve as the input of the secondary data processing pipeline. The secondary pipeline is responsible for distributing the input data blocks to the designated training cards, and the existing data transmission limitations are circumvented by splitting the data processing pipeline.

Citation Information

Cited By

  • Extra-large scene remote sensing interpretation method and system fusing graph convolution and knowledge graph

    CN117456373A