CN113222039B - Training method, device, equipment and medium for remote sensing image target exploration model - Google Patents

Training method, device, equipment and medium for remote sensing image target exploration model Download PDF

Info

Publication number
CN113222039B
CN113222039B CN202110565746.7A CN202110565746A CN113222039B CN 113222039 B CN113222039 B CN 113222039B CN 202110565746 A CN202110565746 A CN 202110565746A CN 113222039 B CN113222039 B CN 113222039B
Authority
CN
China
Prior art keywords
training
training sample
updated
parameter
target
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202110565746.7A
Other languages
Chinese (zh)
Other versions
CN113222039A (en
Inventor
方聪
郑越
黄俊斌
李鹏程
洪亮
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ping An Property and Casualty Insurance Company of China Ltd
Original Assignee
Ping An Property and Casualty Insurance Company of China Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Ping An Property and Casualty Insurance Company of China Ltd filed Critical Ping An Property and Casualty Insurance Company of China Ltd
Priority to CN202110565746.7A priority Critical patent/CN113222039B/en
Publication of CN113222039A publication Critical patent/CN113222039A/en
Application granted granted Critical
Publication of CN113222039B publication Critical patent/CN113222039B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/21Design or setup of recognition systems or techniques; Extraction of features in feature space; Blind source separation
    • G06F18/214Generating training patterns; Bootstrap methods, e.g. bagging or boosting
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/045Combinations of networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V20/00Scenes; Scene-specific elements
    • G06V20/10Terrestrial scenes
    • G06V20/13Satellite images

Abstract

The application relates to the technical field of artificial intelligence, and discloses a training method, a device, equipment and a medium of a remote sensing image target exploration model, wherein the method comprises the following steps: acquiring training samples from a training sample set by adopting a preset number to obtain a target training sample subset; training an initial model according to a target training sample subset by adopting a semi-precision training strategy, wherein the initial model is a model obtained based on a Resnet network; repeatedly executing the steps of acquiring training samples from the training sample set by adopting the preset quantity to obtain a target training sample subset until the preset training ending condition is met, and determining an initial model meeting the preset training ending condition as a remote sensing image target exploration model. The method realizes the training stage of applying the semi-precision training strategy to the remote sensing image target exploration model, and utilizes the semi-precision floating point number to accelerate training under the condition of reducing the precision loss as much as possible, thereby reducing the calculation time consumption and occupied resources.

Description

Training method, device, equipment and medium for remote sensing image target exploration model
Technical Field
The application relates to the technical field of artificial intelligence, in particular to a training method, a training device, training equipment and training media for a remote sensing image target exploration model.
Background
When the traditional remote sensing image target exploration model is constructed, in order to avoid the precision loss of the neural network calculation, the adopted parameter precision is FP32 (namely 32-bit floating point number), and the value range is 1.4x10 < -45 > -3.4x1038. Because the FP32 value occupies a large number of bytes, the time spent in neural network computation is significantly longer than less accurate floating point numbers (e.g., 16-bit floating point numbers), and the occupied resources are also significantly greater than less accurate floating point numbers.
Disclosure of Invention
The application mainly aims to provide a training method, device, equipment and medium for a remote sensing image target exploration model, and aims to solve the technical problems that when the remote sensing image target exploration model is constructed, the parameter precision adopted for avoiding calculation precision loss is 32-bit floating point number, the consumed time is obviously longer than that of the floating point number with smaller precision, and the occupied resources are also obviously larger than that of the floating point number with smaller precision.
In order to achieve the above object, the present application provides a training method for a remote sensing image target exploration model, which includes:
Obtaining a set of training samples, each training sample in the set of training samples comprising: remote sensing image sample data and survey calibration values;
acquiring a preset number, and acquiring the training samples from the training sample set by adopting the preset number to obtain a target training sample subset;
training an initial model according to the target training sample subset by adopting a semi-precision training strategy;
repeating the step of obtaining the training samples from the training sample set by adopting the preset number to obtain a target training sample subset until a preset training ending condition is met, and determining the initial model meeting the preset training ending condition as a remote sensing image target exploration model.
Further, the step of training the initial model according to the target training sample subset by adopting a semi-precision training strategy includes:
acquiring a parameter backup library, wherein the data precision of the data in the parameter backup library is a first precision floating point number;
a second precision floating point number method is adopted based on the parameters to be updated of the initial model, and the remote sensing image sample data of each training sample in the target training sample subset are respectively input into the initial model for exploration and prediction according to the parameter backup library to obtain an exploration sample prediction result set;
Based on the first precision floating point number and the loss function, respectively calculating the loss value of each training sample in the target training sample subset according to the exploration sample prediction result set and all the exploration calibration values in the target training sample subset to obtain a to-be-processed loss value set;
based on the first precision floating point number, updating the parameters to be updated of the initial model according to the parameter backup library and the to-be-processed loss value set, wherein the updated initial model is used for calculating the exploration sample prediction result next time.
Further, the step of updating the parameters to be updated of the initial model according to the parameter backup library and the to-be-processed loss value set based on the first precision floating point number includes:
when the target training sample subset comprises one training sample, carrying out parameter gradient calculation on the parameters to be updated of the initial model according to the to-be-processed loss values in the to-be-processed loss value set based on the second precision floating point number to obtain a first gradient data set to be updated;
acquiring parameters from the parameter backup library as a first parameter set to be calculated;
Based on the first precision floating point number, respectively carrying out addition calculation of the same parameter on the parameters to be updated of the initial model according to the first gradient data set to be updated and the first parameter set to be calculated to obtain a first parameter set to be updated;
updating the parameters to be updated of the initial model according to the first parameter set to be updated;
and updating the parameter backup library according to the first parameter set to be updated.
Further, the step of updating the parameters to be updated of the initial model according to the parameter backup library and the to-be-processed loss value set based on the first precision floating point number includes:
when the target training sample subset comprises a plurality of training samples, based on the second precision floating point number, respectively carrying out parameter gradient calculation on the parameters to be updated of the initial model according to each to-be-processed loss value in the to-be-processed loss value set to obtain a gradient data set to be averaged;
according to the gradient data set to be averaged, carrying out average value calculation on the gradient data of the same parameter on the parameter to be updated of the initial model to obtain a second gradient data set to be updated;
Acquiring parameters from the parameter backup library as a second parameter set to be calculated;
based on the first precision floating point number, respectively carrying out addition calculation on the same parameter of the parameter to be updated of the initial model according to the second gradient data set to be updated and the second parameter set to be calculated to obtain a second parameter set to be updated;
updating all the parameters to be updated of the initial model according to the second parameter set to be updated;
and updating the parameter backup library according to the second parameter set to be updated.
Further, the method for using a second precision floating point number based on the parameters to be updated of the initial model, according to the parameter backup library, respectively inputting the remote sensing image sample data of each training sample in the target training sample subset into the initial model for exploration prediction, so as to obtain an exploration sample prediction result set, including the steps of:
acquiring parameters from the parameter backup library to obtain a parameter set to be processed;
converting the first precision floating point number into a second precision floating point number to obtain a parameter set to be subjected to forward calculation;
And respectively inputting the remote sensing image sample data of each training sample in the target training sample subset into the initial model to perform exploration and prediction to obtain the exploration sample prediction result set, wherein the parameters to be updated of the initial model adopt the parameter set to be calculated in the forward direction.
Further, before the step of training the initial model according to the target training sample subset by adopting the semi-precision training strategy, the method further includes:
taking a first convolution block, a second convolution block, a third convolution block and a fourth convolution block of the Resnet network as a downsampling sub-model to be connected;
taking an average pooling layer, a full connection layer and a softmax layer of the Resnet network as an image context capturing sub-model to be connected;
and sequentially connecting the downsampling sub-model to be connected with the image context capturing sub-model to be connected to obtain the initial model.
Further, the step of repeatedly executing the step of obtaining the training samples from the training sample set by using the preset number to obtain a target training sample subset, until a preset training end condition is met, and after the step of determining the initial model meeting the preset training end condition as a remote sensing image target exploration model, further includes:
Acquiring remote sensing image data to be surveyed;
inputting the remote sensing image data to be surveyed into a remote sensing image target survey model to perform survey prediction;
and obtaining a target survey result output by the remote sensing image target survey model.
The application also provides a training device of the remote sensing image target exploration model, which comprises:
a training sample acquisition module, configured to acquire a training sample set, where each training sample in the training sample set includes: remote sensing image sample data and survey calibration values;
the target training sample subset determining module is used for acquiring a preset number, and acquiring the training samples from the training sample set by adopting the preset number to obtain a target training sample subset;
the model training module is used for training the initial model according to the target training sample subset by adopting a semi-precision training strategy;
and the remote sensing image target exploration model determining module is used for repeatedly executing the steps of acquiring the training samples from the training sample set by adopting the preset quantity to obtain a target training sample subset until a preset training ending condition is met, and determining the initial model meeting the preset training ending condition as a remote sensing image target exploration model.
The application also proposes a computer device comprising a memory storing a computer program and a processor implementing the steps of any of the methods described above when the processor executes the computer program.
The application also proposes a computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, implements the steps of the method of any of the above.
According to the training method, the device, the equipment and the medium of the remote sensing image target exploration model, the training samples are firstly obtained from the training sample set by adopting the preset quantity, the target training sample subset is obtained, then the half-precision training strategy is adopted, the initial model is trained according to the target training sample subset, finally the steps of obtaining the training samples from the training sample set by adopting the preset quantity are repeatedly executed, the target training sample subset is obtained until the preset training ending condition is met, the initial model meeting the preset training ending condition is determined to be the remote sensing image target exploration model, the half-precision training strategy is applied to the training stage of the remote sensing image target exploration model, the half-precision floating point number is utilized to accelerate training under the condition of reducing the precision loss as much as possible, the calculation consumption time is reduced, and the occupied resources are also reduced.
Drawings
FIG. 1 is a flowchart of a training method of a remote sensing image target survey model according to an embodiment of the application;
FIG. 2 is a schematic block diagram of a training apparatus for remote sensing image target exploration model according to an embodiment of the present application;
fig. 3 is a schematic block diagram of a computer device according to an embodiment of the present application.
The achievement of the objects, functional features and advantages of the present application will be further described with reference to the accompanying drawings, in conjunction with the embodiments.
Detailed Description
The present application will be described in further detail with reference to the drawings and examples, in order to make the objects, technical solutions and advantages of the present application more apparent. It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the application.
In order to solve the technical problems that in the prior art, when a remote sensing image target exploration model is constructed, the parameter precision adopted for avoiding the calculation precision loss is 32-bit floating point number, so that the calculation time consumption is longer than that of the floating point number with smaller precision, and the occupied resources are also obviously larger than that of the floating point number with smaller precision, the application provides a remote sensing image target exploration model training method, which is applied to the technical field of artificial intelligence and is further applied to the technical field of neural network of artificial intelligence. According to the training method of the remote sensing image target exploration model, the half-precision training strategy is applied to the training stage of the remote sensing image target exploration model, and under the condition that the precision loss is reduced as much as possible, the half-precision floating point number is utilized to accelerate training, so that the calculation time consumption is reduced, and the occupied resources are also reduced.
Referring to fig. 1, in an embodiment of the present application, a training method for a remote sensing image target exploration model is provided, where the method includes:
s1: obtaining a set of training samples, each training sample in the set of training samples comprising: remote sensing image sample data and survey calibration values;
s2: acquiring a preset number, and acquiring the training samples from the training sample set by adopting the preset number to obtain a target training sample subset;
s3: training an initial model according to the target training sample subset by adopting a semi-precision training strategy;
s4: repeating the step of obtaining the training samples from the training sample set by adopting the preset number to obtain a target training sample subset until a preset training ending condition is met, and determining the initial model meeting the preset training ending condition as a remote sensing image target exploration model.
According to the method, the target training sample subset is obtained by firstly acquiring training samples from the training sample set by the aid of the preset quantity, then training is carried out on the initial model according to the target training sample subset by the aid of the semi-precision training strategy, finally the step of acquiring the training samples from the training sample set by the aid of the preset quantity is repeatedly executed, the target training sample subset is obtained until the preset training ending condition is met, the initial model meeting the preset training ending condition is determined to be the remote sensing image target exploration model, the semi-precision training strategy is applied to the remote sensing image target exploration model, the semi-precision floating point number is utilized to accelerate training under the condition that precision loss is reduced as much as possible, calculation time is shortened, and occupied resources are reduced.
For S1, the training sample set may be obtained from a database, or may be obtained from a user input, or may be obtained from a third party application system.
Each training sample includes: a remote sensing image sample data and a survey calibration value.
In the same training sample, the exploration calibration value is a calibration result of disaster damage classification of each pixel point of the remote sensing image sample data.
The remote sensing image sample data is a digitized remote sensing image. The remote sensing image is a film or a photo for recording electromagnetic wave sizes of various ground objects, and is mainly divided into an aerial photo and a satellite photo.
For S2, the preset number may be 1 or greater than 1.
Optionally, when the preset number is 1, one training sample is sequentially obtained from the training sample set, and the obtained training sample is used as the target training sample subset. Thus realizing the data serial training of the initial model.
Optionally, when the preset number is greater than 1, a plurality of training samples are obtained from the training sample set, and all the obtained training samples are used as the target training sample subset, where the number of training samples in the target training sample subset is the same as the preset number. Thus realizing the data parallel training of the initial model.
And S3, when the initial model is trained according to the target training sample subset, storing a floating point number with larger precision in a local memory for each parameter to be updated of the initial model, forward calculating the floating point number with smaller precision to accelerate training, calculating gradient loss by adopting the floating point number with smaller precision after obtaining a loss value, converting the gradient loss into the floating point number with larger precision according to the parameter to be updated and the gradient loss stored in the local memory, and updating the parameter to be updated of the initial model and the parameter in the memory by adopting the floating point number with larger precision, thereby realizing the reduction of the precision loss of the parameter to be updated of the initial model as much as possible and simultaneously realizing the accelerated training.
The parameters that need to be updated, i.e. the parameters that need to be updated when the initial model is trained.
Alternatively, a network of Resnet (residual error network) is used as the initial model. It will be appreciated that the initial model may also employ other neural networks, not specifically limited herein.
Alternatively, the floating point number with larger precision adopts 32-bit floating point number, and the floating point number with smaller precision adopts 16-bit floating point number.
And for S4, repeatedly executing the steps S2 to S4 until the preset training ending condition is met.
Optionally, when the preset number is 1, the preset training ending condition includes: the loss value to be processed of the initial model reaches a first convergence condition or the first iteration number of the initial model reaches a second convergence condition; the first convergence condition means that the magnitude of a to-be-processed loss value calculated in two adjacent times meets a lipschitz condition (lipschitz continuous condition); the first iteration number reaching the second convergence condition refers to the number of times the initial model is trained, that is, trained once, and the first iteration number is increased by 1.
Optionally, when the preset number is greater than 1, the preset training ending condition includes: the average loss value of the initial model reaches a third convergence condition or the second iteration number of the initial model reaches a fourth convergence condition, wherein the average value of the loss values to be processed, which correspond to all training samples in a target training sample subset, is calculated, and the average loss value is obtained; the third convergence condition means that the magnitude of the average loss value calculated by two adjacent times meets the lipschitz condition (lipschitz continuous condition); the second iteration number reaching the fourth convergence condition refers to the number of target training sample subsets to which the initial model is trained, that is, one target training sample subset is trained, and the second iteration number is increased by 1.
The remote sensing image target exploration model is used for carrying out disaster damage classification prediction on each pixel point of input remote sensing image data, that is, the remote sensing image target exploration model outputs disaster damage classification results of each pixel point in the remote sensing image data. The disaster damage classification result has only one value, and the value is disaster damage or non-disaster damage.
It will be appreciated that steps S1 to S4 may also be used for training of other network models, such as models based on the Bert (language representation model) network.
In one embodiment, the step of training the initial model according to the target training sample subset by using the semi-precision training strategy includes:
s31: acquiring a parameter backup library, wherein the data precision of the data in the parameter backup library is a first precision floating point number;
s32: a second precision floating point number method is adopted based on the parameters to be updated of the initial model, and the remote sensing image sample data of each training sample in the target training sample subset are respectively input into the initial model for exploration and prediction according to the parameter backup library to obtain an exploration sample prediction result set;
s33: based on the first precision floating point number and the loss function, respectively calculating the loss value of each training sample in the target training sample subset according to the exploration sample prediction result set and all the exploration calibration values in the target training sample subset to obtain a to-be-processed loss value set;
S34: based on the first precision floating point number, updating the parameters to be updated of the initial model according to the parameter backup library and the to-be-processed loss value set, wherein the updated initial model is used for calculating the exploration sample prediction result next time.
The embodiment realizes the training stage of applying the half-precision training strategy to the remote sensing image target exploration model, and the half-precision floating point number is utilized to accelerate training under the condition of reducing precision loss as much as possible, so that the calculation time consumption is reduced, and the occupied resources are also reduced.
For S31, a parameter backup library is obtained from the local memory.
And the parameter backup library is backup data of the parameters to be updated of the initial model.
Optionally, the first precision floating point number is set to a 32-bit floating point number.
And S32, respectively inputting the remote sensing image sample data of each training sample in the target training sample subset into the initial model to perform exploration prediction, outputting an exploration sample prediction result aiming at each training sample in the target training sample subset by the initial model, taking all the exploration sample prediction results as an exploration sample prediction result set, wherein the data acquired from the parameter backup library are subjected to first precision floating point number conversion into second precision floating point number so as to obtain a converted parameter set, and then carrying out exploration prediction on parameters required to be updated of the initial model by adopting the converted parameter set. That is, the number of survey sample predictors in the set of survey sample predictors is the same as the number of training samples in the subset of target training samples, and the initial model employs parameters of a second precision floating point number for performing the survey prediction.
Optionally, the second precision floating point number is set to a 16-bit floating point number.
When the number of training samples in the target training sample subset is 1, the initial model adopts one.
When the number of training samples in the target training sample subset is greater than 1, the number of initial models is the same as the number of training samples in the target training sample subset, the parameters to be updated of all the initial models are the same, each initial model is located in a different computer device, and each initial model performs investigation and prediction on one training sample in the target training sample subset. Therefore, the data parallel training of the initial model is realized, the training and reading are further improved, and the calculation time consumption is further reduced.
And S33, inputting the exploration sample prediction result and the exploration calibration value corresponding to the same training sample in the target training sample subset into the loss function to perform loss value calculation, obtaining to-be-processed loss values, and taking all to-be-processed loss values as a to-be-processed loss value set, wherein the accuracy of loss value calculation adopts the first accuracy floating point number. That is, the number of to-be-processed loss values in the to-be-processed loss value set is the same as the number of training samples in the target training sample subset, and the data precision of the to-be-processed loss value set is the first precision floating point number.
And for S34, updating the parameters to be updated of the initial model according to the parameter backup library and the to-be-processed loss value set, wherein the data precision of updating the parameters to be updated of the initial model adopts the first precision floating point number.
In one embodiment, the step of updating the parameters to be updated of the initial model according to the parameter backup library and the to-be-processed loss value set based on the first precision floating point number includes:
s3411: when the target training sample subset comprises one training sample, carrying out parameter gradient calculation on the parameters to be updated of the initial model according to the to-be-processed loss values in the to-be-processed loss value set based on the second precision floating point number to obtain a first gradient data set to be updated;
s3412: acquiring parameters from the parameter backup library as a first parameter set to be calculated;
s3413: based on the first precision floating point number, respectively carrying out addition calculation of the same parameter on the parameters to be updated of the initial model according to the first gradient data set to be updated and the first parameter set to be calculated to obtain a first parameter set to be updated;
S3414: updating the parameters to be updated of the initial model according to the first parameter set to be updated;
s3415: and updating the parameter backup library according to the first parameter set to be updated.
The embodiment realizes updating the initial model based on the first precision floating point number according to the parameter backup library and the to-be-processed loss value set, thereby reducing the precision loss of the to-be-updated parameters of the initial model as much as possible.
For S3411, when the target training sample subset includes one training sample, it means that only one to-be-processed loss value in the to-be-processed loss value set is included, at this time, parameter gradient calculation may be performed on the to-be-updated parameter of the initial model according to the to-be-processed loss value, and the calculated data is used as a first to-be-updated gradient data set, where the second precision floating point number is used when performing parameter gradient calculation. That is, the data precision of the data in the first gradient data set to be updated is the second precision floating point number.
For S3412, parameters are acquired from the parameter backup library, and all acquired parameters are used as a first parameter set to be calculated. That is, the data precision of the data in the first set of parameters to be calculated is the first precision floating point number.
For S3413, obtaining, from the first set of gradient data to be updated, one first gradient data to be updated as target first gradient data to be updated according to the parameter to be added; acquiring a first parameter to be calculated from the first parameter set to be calculated according to the parameters to be added as a target first parameter to be calculated; adding the gradient data to be updated of the target and the first parameter to be calculated of the target by adopting the first precision floating point number, and taking the obtained data as the first parameter to be updated corresponding to the parameter to be added; taking all the first parameters to be updated as the first parameter set to be updated; the parameters to be added are any parameters to be updated of the initial model. That is, the data precision of the data of the first set of parameters to be updated is the first precision floating point number.
For S3414, updating the parameters to be updated of the initial model according to the first set of parameters to be updated so that the precision of the parameters to be updated of the initial model is always kept to be the first precision floating point number.
And for S3415, updating the first parameter set to be updated into the parameter backup library, so that the parameter backup library always backs up the parameter to be updated of the initial model, and the data precision of the data in the parameter backup library is always kept as the first precision floating point number.
In one embodiment, the step of updating the parameters to be updated of the initial model according to the parameter backup library and the to-be-processed loss value set based on the first precision floating point number includes:
s3421: when the target training sample subset comprises a plurality of training samples, based on the second precision floating point number, respectively carrying out parameter gradient calculation on the parameters to be updated of the initial model according to each to-be-processed loss value in the to-be-processed loss value set to obtain a gradient data set to be averaged;
s3422: according to the gradient data set to be averaged, carrying out average value calculation on the gradient data of the same parameter on the parameter to be updated of the initial model to obtain a second gradient data set to be updated;
s3423: acquiring parameters from the parameter backup library as a second parameter set to be calculated;
s3424: based on the first precision floating point number, respectively carrying out addition calculation on the same parameter of the parameter to be updated of the initial model according to the second gradient data set to be updated and the second parameter set to be calculated to obtain a second parameter set to be updated;
S3425: updating all the parameters to be updated of the initial model according to the second parameter set to be updated;
s3426: and updating the parameter backup library according to the second parameter set to be updated.
The embodiment realizes updating the initial model based on the first precision floating point number according to the parameter backup library and the to-be-processed loss value set, thereby reducing the precision loss of the to-be-updated parameters of the initial model as much as possible; and the target training sample subset comprises a plurality of training samples, so that the initial model is subjected to data parallel training, training reading is further improved, and calculation time is further reduced.
For S3421, when the target training sample subset includes a plurality of training samples, it means that the number of to-be-processed loss values in the to-be-processed loss value set is greater than 1, at this time, parameter gradient calculation may be performed on the to-be-updated parameters of the initial model according to each to-be-processed loss value in the to-be-processed loss value set, and gradient data obtained by calculating according to one to-be-processed loss value is taken as gradient data to be averaged, and all to-be-averaged gradient data is taken as gradient data set to be averaged, where the second precision floating point number is adopted when performing parameter gradient calculation. That is, the data precision of the data in the gradient data set to be averaged is the second precision floating point number, the number of gradient data to be averaged in the gradient data set to be averaged being the same as the number of training samples in the target training sample subset.
For S3422, obtaining data from each gradient data to be averaged in the gradient data set to be averaged according to the parameter to be averaged, to obtain a gradient data set to be calculated, so as to extract all gradient data corresponding to the parameter to be averaged; calculating an average value of the gradient data set to be calculated to obtain second gradient data to be updated corresponding to the parameter to be averaged; taking all the second gradient data to be updated as a second gradient data set to be updated; the parameter to be averaged is any parameter of the initial model to be updated. That is, the data precision of the data in the second set of gradient data to be updated is the second precision floating point number.
For S3423, parameters are acquired from the parameter backup library, and all acquired parameters are used as the second parameter set to be calculated. That is, the data precision of the data in the second set of parameters to be calculated is the first precision floating point number.
For S3424, obtaining, from the second gradient data set to be updated, second gradient data to be updated as target second gradient data to be updated according to the parameters to be added; acquiring a second parameter to be calculated from the second parameter set to be calculated according to the parameters to be added as a target second parameter to be calculated; adding the gradient data to be updated of the target second and the parameters to be calculated of the target second by adopting the first precision floating point number to obtain the parameters to be updated of the second corresponding to the parameters to be added; taking all the second parameters to be updated as a second parameter set to be updated; the parameters to be added are any parameters to be updated of the initial model. That is, the data precision of the data of the second set of parameters to be updated is the first precision floating point number.
For S3425, updating the parameters to be updated of the initial model according to the second set of parameters to be updated so that the precision of the parameters to be updated of the initial model is always kept to be the first precision floating point number.
And for S3426, updating the second parameter set to be updated into the parameter backup library, so that the parameter backup library always backs up the parameters to be updated of the initial model, and the data precision of the data in the parameter backup library is always kept as the first precision floating point number.
In one embodiment, the method for using a second precision floating point number based on the parameters to be updated of the initial model, according to the parameter backup library, inputs the remote sensing image sample data of each training sample in the target training sample subset into the initial model to perform exploration prediction, so as to obtain an exploration sample prediction result set, includes:
s321: acquiring parameters from the parameter backup library to obtain a parameter set to be processed;
s322: converting the first precision floating point number into a second precision floating point number to obtain a parameter set to be subjected to forward calculation;
S323: and respectively inputting the remote sensing image sample data of each training sample in the target training sample subset into the initial model to perform exploration and prediction to obtain the exploration sample prediction result set, wherein the parameters to be updated of the initial model adopt the parameter set to be calculated in the forward direction.
In the embodiment, the parameter to be updated of the initial model is subjected to investigation and prediction by adopting the second precision floating point number, so that the accelerated training is realized, the calculation time consumption is reduced, and the occupied resources are also reduced.
And S321, acquiring parameters from the parameter backup library, and taking all acquired parameters as a parameter set to be processed. That is, the data precision of the data in the parameter set to be processed is the first precision floating point number.
And S322, respectively converting the first precision floating point number into the second precision floating point number for each parameter in the parameter set to be processed to obtain the parameter set to be calculated forward. That is, the data precision of the data in the parameter set to be forward calculated is the second precision floating point number.
For S323, updating the parameter set to be calculated in the initial model, and respectively inputting the remote sensing image sample data of each training sample in the target training sample subset into the initial model updated with the parameter set to be calculated in the forward direction for exploration and prediction. Therefore, the second precision floating point number is adopted to conduct exploration prediction, and accelerated training is achieved.
In one embodiment, before the step of training the initial model according to the target training sample subset by using the semi-precision training strategy, the method further includes:
s031: taking a first convolution block, a second convolution block, a third convolution block and a fourth convolution block of the Resnet network as a downsampling sub-model to be connected;
s032: taking an average pooling layer, a full connection layer and a softmax layer of the Resnet network as an image context capturing sub-model to be connected;
s033: and sequentially connecting the downsampling sub-model to be connected with the image context capturing sub-model to be connected to obtain the initial model.
In order to solve the problem, the embodiment adopts the network structure of the Resnet network as an initial model after being simplified, so that the training performance is basically not affected, the calculation time consumption is further reduced, and the occupied resources are further reduced.
For S031, taking the first convolution block, the second convolution block, the third convolution block, and the fourth convolution block of the Resnet network as the downsampling submodel to be connected is equivalent to disconnecting the fourth convolution block of the Resnet network from the fifth convolution block of the Resnet network.
The first convolution block of the Resnet network includes: a convolutional layer and a max-pooling layer, the second convolutional block of the Resnet network comprising: and a residual module, wherein the third convolution block of the Resnet network comprises: a downsampling residual module and the residual module, the fourth convolution block of the Resnet network includes: the downsampling residual module and the residual module, the fifth convolution block of the Resnet network includes: the downsampling residual module and the residual module.
For S032, taking the average pooling layer, the full connection layer and the softmax layer of the Resnet network as the image context capturing sub-model to be connected is equivalent to disconnecting the average pooling layer of the Resnet network and the fifth convolution block of the Resnet network. That is, the number of output channels of the downsampling sub-model to be connected is the same as the number of input channels of the image context capturing sub-model to be connected.
And for S033, the downsampling sub-model to be connected and the image context capturing sub-model to be connected are sequentially connected to obtain the initial model, which is equivalent to taking the fifth convolution block of the Resnet network as the initial model after being removed.
In one embodiment, the step of repeatedly performing the step of obtaining the training samples from the training sample set by using the preset number to obtain a target training sample subset, until a preset training end condition is met, and determining the initial model meeting the preset training end condition as the remote sensing image target exploration model further includes:
s51: acquiring remote sensing image data to be surveyed;
s52: inputting the remote sensing image data to be surveyed into a remote sensing image target survey model to perform survey prediction;
s53: and obtaining a target survey result output by the remote sensing image target survey model.
The embodiment realizes the exploration prediction of the exploration model of the remote sensing image target obtained by training by adopting the semi-precision training strategy.
For S51, the remote sensing image data to be surveyed may be obtained from the database, the remote sensing image data to be surveyed input by the user may be obtained, and the remote sensing image data to be surveyed may be obtained from the third party application system.
The remote sensing image data to be surveyed needs to carry out the digitization remote sensing image of disaster damage classification to each pixel point.
And S52, inputting the remote sensing image data to be surveyed into a remote sensing image target survey model to perform survey prediction so as to realize prediction of disaster damage classification of each pixel point.
And S53, taking the data output by the remote sensing image target exploration model as a target exploration result. That is, the target survey result is a disaster damage classification result of each pixel point in the remote sensing image data to be surveyed.
Referring to fig. 2, the application further provides a training device for a remote sensing image target exploration model, which comprises:
a training sample acquisition module 100, configured to acquire a training sample set, where each training sample in the training sample set includes: remote sensing image sample data and survey calibration values;
the target training sample subset determining module 200 is configured to obtain a preset number, and obtain the training samples from the training sample set by using the preset number to obtain a target training sample subset;
the model training module 300 is configured to train the initial model according to the target training sample subset by adopting a semi-precision training strategy;
the remote sensing image target exploration model determining module 400 is configured to repeatedly execute the steps of obtaining the training samples from the training sample set by using the preset number, and obtaining a target training sample subset until a preset training end condition is met, and determine the initial model meeting the preset training end condition as a remote sensing image target exploration model.
According to the method, the target training sample subset is obtained by firstly acquiring training samples from the training sample set by the aid of the preset quantity, then training is carried out on the initial model according to the target training sample subset by the aid of the semi-precision training strategy, finally the step of acquiring the training samples from the training sample set by the aid of the preset quantity is repeatedly executed, the target training sample subset is obtained until the preset training ending condition is met, the initial model meeting the preset training ending condition is determined to be the remote sensing image target exploration model, the semi-precision training strategy is applied to the remote sensing image target exploration model, the semi-precision floating point number is utilized to accelerate training under the condition that precision loss is reduced as much as possible, calculation time is shortened, and occupied resources are reduced.
Referring to fig. 3, in an embodiment of the present application, there is further provided a computer device, which may be a server, and an internal structure thereof may be as shown in fig. 3. The computer device includes a processor, a memory, a network interface, and a database connected by a system bus. Wherein the computer is configured to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, computer programs, and a database. The memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The database of the computer equipment is used for storing data such as a training method of a remote sensing image target exploration model. The network interface of the computer device is used for communicating with an external terminal through a network connection. The computer program is executed by a processor to implement a method of training a remote sensing image target survey model. The training method of the remote sensing image target exploration model comprises the following steps: obtaining a set of training samples, each training sample in the set of training samples comprising: remote sensing image sample data and survey calibration values; acquiring a preset number, and acquiring the training samples from the training sample set by adopting the preset number to obtain a target training sample subset; training an initial model according to the target training sample subset by adopting a semi-precision training strategy; repeating the step of obtaining the training samples from the training sample set by adopting the preset number to obtain a target training sample subset until a preset training ending condition is met, and determining the initial model meeting the preset training ending condition as a remote sensing image target exploration model.
According to the method, the target training sample subset is obtained by firstly acquiring training samples from the training sample set by the aid of the preset quantity, then training is carried out on the initial model according to the target training sample subset by the aid of the semi-precision training strategy, finally the step of acquiring the training samples from the training sample set by the aid of the preset quantity is repeatedly executed, the target training sample subset is obtained until the preset training ending condition is met, the initial model meeting the preset training ending condition is determined to be the remote sensing image target exploration model, the semi-precision training strategy is applied to the remote sensing image target exploration model, the semi-precision floating point number is utilized to accelerate training under the condition that precision loss is reduced as much as possible, calculation time is shortened, and occupied resources are reduced.
An embodiment of the present application further provides a computer readable storage medium having stored thereon a computer program which when executed by a processor implements a training method for a remote sensing image target survey model, comprising the steps of: obtaining a set of training samples, each training sample in the set of training samples comprising: remote sensing image sample data and survey calibration values; acquiring a preset number, and acquiring the training samples from the training sample set by adopting the preset number to obtain a target training sample subset; training an initial model according to the target training sample subset by adopting a semi-precision training strategy; repeating the step of obtaining the training samples from the training sample set by adopting the preset number to obtain a target training sample subset until a preset training ending condition is met, and determining the initial model meeting the preset training ending condition as a remote sensing image target exploration model.
According to the training method of the remote sensing image target exploration model, the training samples are firstly obtained from the training sample set by adopting the preset quantity, the target training sample subset is obtained, then the half-precision training strategy is adopted, the initial model is trained according to the target training sample subset, finally the step of obtaining the target training sample subset from the training sample set by repeatedly executing the preset quantity is performed until the preset training ending condition is met, the initial model meeting the preset training ending condition is determined as the remote sensing image target exploration model, the half-precision training strategy is applied to the training stage of the remote sensing image target exploration model, the half-precision floating point number is utilized to accelerate training under the condition that the precision loss is reduced as much as possible, the calculation consumption time is shortened, and occupied resources are also reduced.
Those skilled in the art will appreciate that implementing all or part of the above described methods may be accomplished by way of a computer program stored on a non-transitory computer readable storage medium, which when executed, may comprise the steps of the embodiments of the methods described above. Any reference to memory, storage, database, or other medium provided by the present application and used in embodiments may include non-volatile and/or volatile memory. The nonvolatile memory can include Read Only Memory (ROM), programmable ROM (PROM), electrically Programmable ROM (EPROM), electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual speed data rate SDRAM (SSRSDRAM), enhanced SDRAM (ESDRAM), synchronous Link DRAM (SLDRAM), memory bus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), among others.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, apparatus, article, or method that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, apparatus, article, or method. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, apparatus, article or method that comprises the element.
The foregoing description is only of the preferred embodiments of the present application and is not intended to limit the scope of the application, and all equivalent structures or equivalent processes using the descriptions and drawings of the present application or directly or indirectly applied to other related technical fields are included in the scope of the application.

Claims (7)

1. A method for training a remote sensing image target exploration model, the method comprising:
obtaining a set of training samples, each training sample in the set of training samples comprising: remote sensing image sample data and survey calibration values;
Acquiring a preset number, and acquiring the training samples from the training sample set by adopting the preset number to obtain a target training sample subset;
training an initial model according to the target training sample subset by adopting a semi-precision training strategy;
repeatedly executing the steps of acquiring the training samples from the training sample set by the preset quantity to obtain a target training sample subset until a preset training ending condition is met, and determining the initial model meeting the preset training ending condition as a remote sensing image target exploration model;
the step of training the initial model according to the target training sample subset by adopting a semi-precision training strategy comprises the following steps:
acquiring a parameter backup library, wherein the data precision of the data in the parameter backup library is a first precision floating point number;
a second precision floating point number method is adopted based on the parameters to be updated of the initial model, and the remote sensing image sample data of each training sample in the target training sample subset are respectively input into the initial model for exploration and prediction according to the parameter backup library to obtain an exploration sample prediction result set;
Based on the first precision floating point number and the loss function, respectively calculating the loss value of each training sample in the target training sample subset according to the exploration sample prediction result set and all the exploration calibration values in the target training sample subset to obtain a to-be-processed loss value set;
updating the parameters to be updated of the initial model according to the parameter backup library and the to-be-processed loss value set based on the first precision floating point number, wherein the updated initial model is used for calculating the exploration sample prediction result next time;
the step of updating the parameters to be updated of the initial model according to the parameter backup library and the to-be-processed loss value set based on the first precision floating point number comprises the following steps:
when the target training sample subset comprises a plurality of training samples, based on the second precision floating point number, respectively carrying out parameter gradient calculation on the parameters to be updated of the initial model according to each to-be-processed loss value in the to-be-processed loss value set to obtain a gradient data set to be averaged;
according to the gradient data set to be averaged, carrying out average value calculation on the gradient data of the same parameter on the parameter to be updated of the initial model to obtain a second gradient data set to be updated;
Acquiring parameters from the parameter backup library as a second parameter set to be calculated;
based on the first precision floating point number, respectively carrying out addition calculation on the same parameter of the parameter to be updated of the initial model according to the second gradient data set to be updated and the second parameter set to be calculated to obtain a second parameter set to be updated;
updating all the parameters to be updated of the initial model according to the second parameter set to be updated;
updating the parameter backup library according to the second parameter set to be updated;
before the step of training the initial model according to the target training sample subset by adopting the semi-precision training strategy, the method further comprises the following steps:
taking a first convolution block, a second convolution block, a third convolution block and a fourth convolution block of the Resnet network as a downsampling sub-model to be connected;
taking an average pooling layer, a full connection layer and a softmax layer of the Resnet network as an image context capturing sub-model to be connected;
sequentially connecting the downsampling sub-model to be connected with the image context capturing sub-model to be connected to obtain the initial model;
The first convolution block of the Resnet network includes: a convolutional layer and a max-pooling layer, the second convolutional block of the Resnet network comprising: and a residual module, wherein the third convolution block of the Resnet network comprises: a downsampling residual module and the residual module, the fourth convolution block of the Resnet network includes: the downsampling residual module and the residual module.
2. The method according to claim 1, wherein the step of updating the parameters to be updated of the initial model according to the parameter backup library and the set of to-be-processed loss values based on the first precision floating point number comprises:
when the target training sample subset comprises one training sample, carrying out parameter gradient calculation on the parameters to be updated of the initial model according to the to-be-processed loss values in the to-be-processed loss value set based on the second precision floating point number to obtain a first gradient data set to be updated;
acquiring parameters from the parameter backup library as a first parameter set to be calculated;
based on the first precision floating point number, respectively carrying out addition calculation of the same parameter on the parameters to be updated of the initial model according to the first gradient data set to be updated and the first parameter set to be calculated to obtain a first parameter set to be updated;
Updating the parameters to be updated of the initial model according to the first parameter set to be updated;
and updating the parameter backup library according to the first parameter set to be updated.
3. The method for training a remote sensing image target exploration model according to claim 1, wherein the method for adopting a second precision floating point number based on parameters to be updated of the initial model includes the steps of respectively inputting the remote sensing image sample data of each training sample in the target training sample subset into the initial model for exploration prediction according to the parameter backup library to obtain an exploration sample prediction result set, and the method comprises the following steps:
acquiring parameters from the parameter backup library to obtain a parameter set to be processed;
converting the first precision floating point number into a second precision floating point number to obtain a parameter set to be subjected to forward calculation;
and respectively inputting the remote sensing image sample data of each training sample in the target training sample subset into the initial model to perform exploration and prediction to obtain the exploration sample prediction result set, wherein the parameters to be updated of the initial model adopt the parameter set to be calculated in the forward direction.
4. The method according to claim 1, wherein the step of repeatedly performing the step of obtaining the training samples from the training sample set by using the preset number to obtain a target training sample subset until a preset training end condition is satisfied, and determining the initial model satisfying the preset training end condition as the remote sensing image target survey model further comprises:
acquiring remote sensing image data to be surveyed;
inputting the remote sensing image data to be surveyed into a remote sensing image target survey model to perform survey prediction;
and obtaining a target survey result output by the remote sensing image target survey model.
5. A training device for remote sensing image target survey models for implementing the method of any one of claims 1 to 4, the device comprising:
a training sample acquisition module, configured to acquire a training sample set, where each training sample in the training sample set includes: remote sensing image sample data and survey calibration values;
the target training sample subset determining module is used for acquiring a preset number, and acquiring the training samples from the training sample set by adopting the preset number to obtain a target training sample subset;
The model training module is used for training the initial model according to the target training sample subset by adopting a semi-precision training strategy;
and the remote sensing image target exploration model determining module is used for repeatedly executing the steps of acquiring the training samples from the training sample set by adopting the preset quantity to obtain a target training sample subset until a preset training ending condition is met, and determining the initial model meeting the preset training ending condition as a remote sensing image target exploration model.
6. A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that the processor implements the steps of the method of any of claims 1 to 4 when the computer program is executed.
7. A computer readable storage medium, on which a computer program is stored, characterized in that the computer program, when being executed by a processor, implements the steps of the method of any of claims 1 to 4.
CN202110565746.7A 2021-05-24 2021-05-24 Training method, device, equipment and medium for remote sensing image target exploration model Active CN113222039B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110565746.7A CN113222039B (en) 2021-05-24 2021-05-24 Training method, device, equipment and medium for remote sensing image target exploration model

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110565746.7A CN113222039B (en) 2021-05-24 2021-05-24 Training method, device, equipment and medium for remote sensing image target exploration model

Publications (2)

Publication Number Publication Date
CN113222039A CN113222039A (en) 2021-08-06
CN113222039B true CN113222039B (en) 2023-09-05

Family

ID=77099386

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110565746.7A Active CN113222039B (en) 2021-05-24 2021-05-24 Training method, device, equipment and medium for remote sensing image target exploration model

Country Status (1)

Country Link
CN (1) CN113222039B (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109801293A (en) * 2019-01-08 2019-05-24 平安科技(深圳)有限公司 Remote Sensing Image Segmentation, device and storage medium, server
CN111582229A (en) * 2020-05-21 2020-08-25 中国科学院空天信息创新研究院 Network self-adaptive semi-precision quantized image processing method and system
WO2021012898A1 (en) * 2019-07-23 2021-01-28 平安科技(深圳)有限公司 Artificial intelligence-based agricultural insurance surveying method and related device

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109801293A (en) * 2019-01-08 2019-05-24 平安科技(深圳)有限公司 Remote Sensing Image Segmentation, device and storage medium, server
WO2021012898A1 (en) * 2019-07-23 2021-01-28 平安科技(深圳)有限公司 Artificial intelligence-based agricultural insurance surveying method and related device
CN111582229A (en) * 2020-05-21 2020-08-25 中国科学院空天信息创新研究院 Network self-adaptive semi-precision quantized image processing method and system

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
基于FPGA的飞行器关键点检测加速器设计与实现;秦步月 等;舰船电子工程(03);第154-160页 *

Also Published As

Publication number Publication date
CN113222039A (en) 2021-08-06

Similar Documents

Publication Publication Date Title
US10949717B2 (en) Generating images using neural networks
CN111160375B (en) Three-dimensional key point prediction and deep learning model training method, device and equipment
CN111028153B (en) Image processing and neural network training method and device and computer equipment
CN115170934B (en) Image segmentation method, system, equipment and storage medium
CN112949462B (en) Three-dimensional human body posture estimation method, device, equipment and storage medium
CN112508125A (en) Efficient full-integer quantization method of image detection model
CN111383741B (en) Method, device and equipment for establishing medical imaging model and storage medium
CN112101318A (en) Image processing method, device, equipment and medium based on neural network model
US20210019555A1 (en) Generating video frames using neural networks
CN112419153A (en) Image super-resolution reconstruction method and device, computer equipment and storage medium
CN112183295A (en) Pedestrian re-identification method and device, computer equipment and storage medium
CN109756740B (en) Half tensor image compression method and image recovery method based on optimal measurement matrix
CN111553477A (en) Image processing method, device and storage medium
CN107292322B (en) Image classification method, deep learning model and computer system
CN113222039B (en) Training method, device, equipment and medium for remote sensing image target exploration model
CN112990107B (en) Hyperspectral remote sensing image underwater target detection method and device and computer equipment
CN110570487A (en) Undersampling model generation method, image reconstruction method, device and computer equipment
CN114092804A (en) Method and device for identifying remote sensing image
CN112348774A (en) CT image segmentation method, terminal and storage medium suitable for bladder cancer
CN114742990A (en) Target detection method, device and equipment based on artificial intelligence and storage medium
CN112200845A (en) Image registration method and device
CN116127403B (en) Information fusion method, device and storage medium based on cross-modal feature recalibration
CN115205710B (en) Double-time-phase remote sensing image change detection method combined with color correction
CN116245779B (en) Image fusion method and device, storage medium and electronic equipment
CN113139893B (en) Image translation model construction method and device and image translation method and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant