CN111325281B - Training method and device for deep learning network, computer equipment and storage medium - Google Patents

Training method and device for deep learning network, computer equipment and storage medium Download PDF

Info

Publication number
CN111325281B
CN111325281B CN202010146486.5A CN202010146486A CN111325281B CN 111325281 B CN111325281 B CN 111325281B CN 202010146486 A CN202010146486 A CN 202010146486A CN 111325281 B CN111325281 B CN 111325281B
Authority
CN
China
Prior art keywords
image
training
deep learning
learning network
images
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
CN202010146486.5A
Other languages
Chinese (zh)
Other versions
CN111325281A (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.)
New Hope Liuhe Co Ltd
Original Assignee
New Hope Liuhe Co 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 New Hope Liuhe Co Ltd filed Critical New Hope Liuhe Co Ltd
Priority to CN202010146486.5A priority Critical patent/CN111325281B/en
Publication of CN111325281A publication Critical patent/CN111325281A/en
Application granted granted Critical
Publication of CN111325281B publication Critical patent/CN111325281B/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
    • 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/213Feature extraction, e.g. by transforming the feature space; Summarisation; Mappings, e.g. subspace methods
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/24Classification techniques
    • G06F18/241Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches
    • 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
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/20Image preprocessing
    • G06V10/26Segmentation of patterns in the image field; Cutting or merging of image elements to establish the pattern region, e.g. clustering-based techniques; Detection of occlusion

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Evolutionary Computation (AREA)
  • General Engineering & Computer Science (AREA)
  • Artificial Intelligence (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Evolutionary Biology (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Health & Medical Sciences (AREA)
  • Multimedia (AREA)
  • Biomedical Technology (AREA)
  • Biophysics (AREA)
  • Computational Linguistics (AREA)
  • General Health & Medical Sciences (AREA)
  • Molecular Biology (AREA)
  • Computing Systems (AREA)
  • Mathematical Physics (AREA)
  • Software Systems (AREA)
  • Image Analysis (AREA)

Abstract

The application relates to a training method, a training device, computer equipment and a storage medium of a deep learning network. The method comprises the following steps: loading a training image and a marking image; the marking image is obtained by marking the feature in the training image; according to a preset block size, performing block segmentation on the training image to obtain a plurality of image blocks; after the feature extraction processing is carried out on the image blocks, mapping processing is carried out on the processed image blocks and the marked image; and carrying out parameter adjustment learning on the mapped image block and the marked image to obtain parameters of the deep learning network. By adopting the method, the training efficiency can be improved under the condition of ensuring the accuracy of the identification result.

Description

Training method and device for deep learning network, computer equipment and storage medium
Technical Field
The present application relates to the field of image processing technologies, and in particular, to a training method and apparatus for a deep learning network, a computer device, and a storage medium.
Background
In the farming industry, deep learning networks can be used to identify animals, to count animals or to analyze animal behavior. However, in the training process of the deep learning network, after the images of the animals are acquired, when a plurality of images are used as training samples to perform model training, the sizes of the images are different, for example, 2000 x 3000 x 3, 3000 x 2000 x 3, or 1000 x 600 x 3, etc., so that the length and width dimensions are not close, and the aspect ratios may also be very different. Due to the existence of the full-connection layer in the deep learning regression model, the size of the training samples input in batch needs to be limited to ensure that the loaded training samples have consistent sizes (for example, 896×896×3), and the process can be understood as size normalization. However, the size normalization loses the definition of the image, and even may completely lose small targets on the image, that is, the accuracy of feature local extraction in the later deep learning training may be affected, resulting in the reduction of the accuracy of the recognition result. Although training can be performed by using a traditional image segmentation method to ensure accuracy of the recognition result, normalization processing is required to be performed on the segmented image areas, so that training speed is reduced. Therefore, how to improve the training efficiency under the condition of ensuring the accuracy of the recognition result is a necessary problem when the deep learning network training is performed.
Disclosure of Invention
In view of the foregoing, it is desirable to provide a training method, device, computer apparatus, and storage medium for a deep learning network that can improve training efficiency while ensuring accuracy of recognition results.
In a first aspect, a training method of a deep learning network is provided, the method comprising:
loading a training image and a marking image; the marking image is obtained by marking the feature in the training image;
according to a preset block size, performing block segmentation on the training image to obtain a plurality of image blocks;
after the feature extraction processing is carried out on the image blocks, mapping processing is carried out on the processed image blocks and the marked image;
and carrying out parameter adjustment learning on the mapped image block and the marked image to obtain parameters of the deep learning network.
In one embodiment, when the training images are multiple, each training image corresponds to a different set of image blocks, and the number of image blocks included in each set of image blocks is the same.
In one embodiment, the step of performing block segmentation on the training image according to a preset block size to obtain a plurality of image blocks includes:
acquiring a preset sliding step length and the block size;
and performing sliding segmentation processing on the training image according to the sliding step length and the block size to obtain a plurality of image blocks.
In one embodiment, when the training images are multiple, each training image corresponds to a different set of image blocks, and the size of the spliced image blocks in each set of image blocks is the same as the size of the training image before segmentation.
In one embodiment, before the loading of the training image, the method further comprises:
acquiring a plurality of training images;
carrying out random sorting processing on a plurality of training images by utilizing a shuffle module;
carrying out batch classification on the training images subjected to the random sorting treatment to obtain a plurality of batches of training images;
and loading training images in batches for training.
In one embodiment, further comprising:
if training images of each batch are loaded for training, determining that one round of training is completed;
and carrying out random sorting processing on indexes of the training images by utilizing a shuffle module, and carrying out next training.
In one embodiment, after the step of determining that a round of training is completed, further comprising:
updating the training round number;
and if the training round number does not reach the preset round number, carrying out random sorting processing on indexes of a plurality of training images by utilizing a shuffle module, and carrying out next round of training.
In a second aspect, there is provided a training apparatus for a deep learning network, the apparatus comprising:
the image loading module is used for loading training images and marking images; the marking image is obtained by marking the features in the training image;
the block segmentation module is used for carrying out block segmentation on the training image according to a preset segmentation size to obtain a plurality of image blocks;
the mapping processing module is used for performing feature extraction processing on the plurality of image blocks and then performing mapping processing on the plurality of processed image blocks and the marked image;
and the parameter adjustment learning module is used for carrying out parameter adjustment learning on the mapped image block and the marked image to obtain parameters of the deep learning network.
In a third aspect, there is provided a computer device comprising a memory storing a computer program and a processor implementing the following steps when the processor executes the computer program:
loading a training image and a marking image; the marking image is obtained by marking the feature in the training image;
according to a preset block size, performing block segmentation on the training image to obtain a plurality of image blocks;
after the feature extraction processing is carried out on the image blocks, mapping processing is carried out on the processed image blocks and the marked image;
and carrying out parameter adjustment learning on the mapped image block and the marked image to obtain parameters of the deep learning network.
In a fourth aspect, there is provided a computer readable storage medium having stored thereon a computer program which when executed by a processor performs the steps of:
loading a training image and a marking image; the marking image is obtained by marking the feature in the training image;
according to a preset block size, performing block segmentation on the training image to obtain a plurality of image blocks;
after the feature extraction processing is carried out on the image blocks, mapping processing is carried out on the processed image blocks and the marked image;
and carrying out parameter adjustment learning on the mapped image block and the marked image to obtain parameters of the deep learning network.
According to the training method, the training device, the computer equipment and the storage medium of the deep learning network, the training image and the marking image are loaded firstly, then the training image is segmented according to the preset block size to obtain the image blocks, after the feature extraction processing is carried out on the image blocks, the mapping processing is carried out on the image blocks and the marking image after the feature extraction processing, the parameter adjustment learning is carried out on the image blocks and the marking image after the mapping processing, the parameters of the deep learning network are obtained, the loss of image information is avoided, the accuracy of the identification result is ensured, the training image and the marking image are loaded firstly, then the block segmentation processing is carried out, the image blocks obtained after the segmentation are not needed, the condition of carrying out corresponding block segmentation on the marking image is avoided, the loading time and the block segmentation time of the deep learning network are saved, and the training efficiency is improved.
Drawings
FIG. 1 is an internal block diagram of a computer device in one embodiment;
FIG. 2 is a flow chart of a training method of the deep learning network in one embodiment;
FIG. 3 is a flow chart of a training method of a deep learning network according to another embodiment;
fig. 4 is a block diagram of a training apparatus of a deep learning network in one embodiment.
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.
Reference in the specification to "an embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment may be included in at least one embodiment of the application. The appearances of such phrases in various places in the specification are not necessarily all referring to the same embodiment, nor are separate or alternative embodiments mutually exclusive of other embodiments. Those of skill in the art will explicitly and implicitly appreciate that the described embodiments of the application may be combined with other embodiments.
The training method of the deep learning network provided by the application can be applied to the computer equipment shown in the figure 1. The computer device may be a server, the internal structure of which may be as shown in FIG. 1. The computer device includes a processor, a memory, and a network interface connected by a system bus. Wherein the processor of the computer device 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 internal 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 device is for storing training data for the deep learning network. 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 training method for a deep learning network.
It will be appreciated by those skilled in the art that the architecture shown in fig. 1 is merely a block diagram of some of the architecture relevant to the present inventive arrangements and is not limiting as to the computer device to which the present inventive arrangements may be implemented, as a particular computer device may include more or less components than those shown, or may be combined with some components, or may have a different arrangement of components.
In the agriculture and animal husbandry industry, images of animals can be acquired, the images are utilized to train the deep learning network, the trained deep learning network can be used for identifying the animals, then the number of the animals is calculated or the behaviors of the animals are analyzed, but in the process of training the deep learning network, the training efficiency is difficult to improve under the condition that the accuracy of the identification result is guaranteed. According to the training method of the deep learning network, after the training image and the marker image are acquired by the deep learning network, the image blocks are obtained through block segmentation according to the preset segmentation size, and the image blocks and the marker image after feature extraction processing are mapped, so that parameters of the deep learning network are obtained, and the training efficiency of the deep learning network is improved under the condition that the accuracy of the recognition result is ensured.
Training images may be understood as images used to train the deep learning network, and correspondingly, parameters corresponding to training images may be referred to as training parameters; the marker image may be understood as a standard image for reference during training, and correspondingly, parameters corresponding to the marker image may be referred to as standard parameters; in the process of feature learning of the deep network, training parameters are continuously adjusted to approach standard parameters.
It can be understood that the training method of the deep learning network provided by the application can be used for identifying automobiles and the like, and the identification of animals does not limit the training method of the deep learning network.
In one embodiment, as shown in fig. 2, a training method of a deep learning network is provided, and the embodiment is applied to a server by the method, and can also be applied to a system including a terminal and a server, and the implementation of the interaction by the terminal and the server can be implemented in the following specific ways: the training image and the marking image are sent to the server by the terminal, and then the deep learning network of the server can train in a mode of loading the training image and the marking image. In this embodiment, the method includes the steps of:
step S202, loading training images and marking images.
The marked image (also referred to as a group trunk) may be an image obtained by marking a feature in the training image, and the feature may be different for a deep learning network of different purposes, for example, the feature may be a pig, a cow, or the like in the deep learning network for identifying animals, and for example, the feature may be an off-road vehicle, a bus, a truck, or the like in the deep learning network for identifying automobiles. The manner of marking the features in the training image may be: the method comprises the steps of marking a feature object in a training image in a processing mode such as a picture frame and a scribing, taking a deep learning network for identifying automobiles as an example, carrying out picture frame processing on the automobiles in the training image, further marking, and taking the training image after picture frame processing as a marking image
In the step, the deep learning network loads training images and corresponding mark images; it will be appreciated that since each training image has its corresponding marker image, the number of marker images loaded by the deep learning network is consistent with the training images when the training images are loaded, for example, 16 training images and 16 corresponding marker images, then the deep learning network needs to load 16 training images and 16 marker images.
Step S204, according to the preset block size, the training image is segmented into a plurality of image blocks.
After the training image is loaded by the deep learning network, the training image is positioned in the deep learning network, at the moment, a server acquires a preset block size, and the training image is subjected to block segmentation to obtain a plurality of image blocks.
The block size may be determined according to the size that can be processed by the full convolution module in the deep learning network, for example, the maximum size that can be processed by the full convolution module is a×b, and then the block size is any size within the range of a×b; further, to further increase the training speed, the maximum size that can be handled by the full convolution module may be taken as a block size, and in this case, a×b may be taken as a block size.
Since an image can be regarded as being composed of a plurality of pixels, an image block obtained by dividing a training image can be understood as an image area between a pixel level and an image level; the block segmentation of the training image may be implemented based on a pixel level method (e.g., a patch method, and the corresponding image block may be referred to as a patch image). When the block division is performed based on the pixel level method, the block size may be understood as the number of pixels included in each image block obtained by the block division.
In order to ensure accuracy of recognition results, in one embodiment of the application, a plurality of training images are utilized for training, specifically, after a deep learning network loads the plurality of training images, each training image is respectively segmented according to a preset block size to obtain corresponding image block sets, wherein the number of image blocks included in each image block set is the same as the number of image blocks included in each training image are segmented according to the preset block size; it should be noted that, the deep learning network may load the marker image corresponding to the training image at the same time. Taking training by using 16 training images, and dividing one training image according to a preset block size to obtain 4 image blocks as an example, since the block division of one training image can obtain 4 image blocks, the 4 image blocks can be regarded as an image block set; after loading 16 training images and 16 marking images, the deep learning network performs block segmentation on each training image to obtain 16 image block sets, namely 64 image blocks; in this case, the deep learning network does not need to segment the marker image in blocks.
In step S206, after the feature extraction processing is performed on the plurality of image blocks, the mapping processing is performed on the plurality of processed image blocks and the marker image.
Before the block segmentation is performed on the training image, each of the marker images has a corresponding training image, and after the block segmentation processing in step S204, the training image is segmented into a plurality of image blocks, and then the feature extraction processing is performed on the plurality of image blocks, where the server needs to perform the mapping processing on the plurality of image blocks after the feature extraction processing and the corresponding marker images, that is, associate the image blocks after the feature extraction processing with the corresponding marker images. If there are image block sets of multiple training images, the server may perform mapping processing on the multiple image blocks after feature extraction processing and the corresponding marked images, where feature extraction processing is performed on the image blocks in the image block set to obtain the image block set after feature extraction processing, and mapping the image block set after feature extraction processing and the marked images, so that a mapping relationship is formed between the image blocks in the image block set and the marked images. Taking 16 image block sets, each image block set comprises 4 image blocks as an example introduction, after the server divides 16 training images, 16 image block sets are obtained, then feature extraction processing is carried out on each image block in the 16 image block sets, 16 image block sets after the feature extraction processing are obtained, at this time, the server maps each image block set after the feature extraction processing and a corresponding marked image respectively, so that 4 image blocks in each image block set and the same marked image form a mapping relation.
And step S208, performing parameter adjustment learning on the mapped image block and the marked image to obtain parameters of the deep learning network.
The deep learning network processes the image block to obtain corresponding training parameters, and processes the marked image to obtain standard parameters, so that parameter adjustment learning can be understood as a process of adjusting the training parameters to approach the standard parameters. After the image block and the marked image are mapped, the server performs parameter adjustment learning by using the mapped image block and the marked image, so that the training parameters approach the standard parameters, and the parameters of the deep learning network are determined.
In a possible case, the block segmentation processing can be performed on the training images, then the obtained image blocks are loaded into the deep learning network to perform training of the deep learning network, for example, the block segmentation processing is performed on 16 training images (each training image is segmented into 4 image blocks) to obtain 64 image blocks, and the 64 image blocks are loaded into the deep learning network, so that the time for loading the images by the deep learning network is increased, and the training speed is further reduced; in addition, the space for deep network learning training is increased in this way, because the deep learning network can perform parameter adjustment learning only when each loaded image has its corresponding mark image in the training process, if the training image is firstly subjected to block segmentation processing, and then each image block has its corresponding mark block, that is, the mark image needs to be subjected to the same block segmentation processing to obtain the mark block, and then the image block and the mark block are loaded into the deep learning network together, and the description is given by taking 16 training images and dividing each training image into 4 image blocks as an example: the block segmentation processing is performed on the 16 training images and the 16 marking images respectively to obtain 64 image blocks and 64 marking blocks, and the 64 image blocks and the 64 marking blocks are loaded into the deep learning network, that is, the training space needs to be enough to accommodate the 64 image blocks and the 64 marking blocks. Therefore, the training image is firstly subjected to block segmentation processing, the obtained image blocks are loaded into the deep learning network, and the training mode of the deep learning network is realized, so that the loss of image information can be avoided, the image accuracy is ensured, but the loaded images are increased, the loading time is increased, the training speed is further reduced, and the space required by training is also increased.
Compared with the method for loading after the block segmentation, the training method for the deep learning network provided by the application has the advantages that the training image and the marking image are loaded firstly, then the training image is segmented according to the preset block size to obtain the image block, after the feature extraction processing is carried out on the image block, the mapping processing is carried out on the image block and the marking image after the feature extraction processing, the parameter adjustment learning is carried out on the image block and the marking image after the mapping processing, so that the parameters of the deep learning network are obtained, the loss of image information is avoided, the accuracy of a recognition result is ensured, the training image and the marking image are loaded firstly, then the block segmentation processing is carried out, thus the image block obtained after the segmentation is not needed, the corresponding block segmentation condition of the marking image is avoided, the loading time and the block segmentation time of the deep learning network are saved, the training efficiency is improved, and the space required in the training process is saved because the block segmentation is not needed.
It should be noted that, in step S204, the server may preset the block size, so as to increase the training speed and ensure the accuracy of the recognition result. In one possible case, if the server performs block segmentation on the training image according to any size, since the full convolution network has a requirement on the size of the processable size, the server also needs to perform normalization processing on the image block of any size, resulting in an increase in training time, so that the training speed is reduced, and it is difficult to ensure the accuracy of the recognition result because part of the image information is lost due to the normalization processing.
In one possible case, if the training image is divided according to only the block size, there may occur a case where a part of the image area cannot be included in the divided blocks at the time of division, that is, there is a problem that adjacent image blocks are not continuous, resulting in that the entire information of the training image cannot be included in the image blocks, and the accuracy of the recognition result is reduced. According to one embodiment of the application, a method of block segmentation by utilizing a sliding step length and a block size is adopted, so that a plurality of segmented image blocks can contain the information of the whole training image; specifically, a server acquires a preset sliding step length and a preset block size, and performs sliding segmentation processing on a training image according to the sliding step length and the block size to obtain a plurality of image blocks; it can be understood that at this time, the image blocks can be directly spliced to obtain the original training image, that is, the splicing size obtained after each image block is spliced is the same as the size of the training image before segmentation; further, it may be further understood that when there are a plurality of training images, each training image corresponds to a different set of image blocks, and the size of the spliced image blocks in each set of image blocks is the same as the size of the training image before segmentation.
When training of the deep learning network is performed by utilizing a plurality of training images (which can be regarded as an image training set), the deep learning network can be divided into a plurality of batches to load the training images, so that batch training is realized; if all training images are loaded, that is, after the deep learning network loads each batch of training images for training, a round of training can be determined to be completed, and the server can perform the next round of training.
In one example, the server performing batch training may specifically include: the method comprises the steps that a server firstly obtains a plurality of training images, a shuffle module is used for carrying out random sorting processing on the plurality of training images, then batch classification is carried out on the training images after the random sorting processing to obtain a plurality of batches of training images, the training images are loaded in batches to carry out training, the random sorting process can be understood as a shuffle process, and correspondingly, a module for realizing the shuffle process can be called a shuffle module.
In one possible scenario, to avoid a situation in which the server continues to train, the server may stop training when the number of training rounds reaches the preset number of rounds according to the preset number of rounds. Specifically, after one training round is completed, the server updates the training round number, and if the training round number does not reach the preset round number, the next training round is continued, wherein the method of updating the training round number by the server may be to add 1 to the epoch, and the epoch is used for representing the training round number.
Further, in order to further ensure accuracy of the recognition result, before performing the next round of training, the server may perform random sorting processing on the plurality of training images after training, and perform the next round of training by using the training images after the random sorting processing, that is, after loading each batch of training images for training, the server determines to complete one round of training, then performs random sorting processing on the plurality of training images, and performs the next round of training by using the training images after the random sorting processing; the method for performing the random sorting process on the multiple training images may be to acquire an index (index) of the training image, and then perform the random sorting process on the index by using a shuffle module.
Fig. 3 shows another embodiment of the training method of the deep learning network of the present application, which is described below by taking an application scenario of identifying animals as an example with reference to fig. 3:
the animal image training set comprises a training image and a marking image, wherein the marking image can be obtained by marking a pig (taking the pig as a feature in the embodiment) in the training image in a picture frame; after obtaining the image training set of the animal, the server loads the training images and the marker images into the deep learning network in batches and trains, wherein the training process by using each batch of training images comprises steps S302 to S308, specifically, the steps S302 to S308 are as follows:
step S302, loading a training image and a corresponding mark image;
step S304, performing patch segmentation on the training image according to a preset sliding step length and a preset block size to obtain a plurality of image block sets, wherein the number of the image blocks included in each image block set is the same;
step S306, after the feature extraction processing is performed on the image blocks in the image block set, mapping processing is performed on the image blocks and the marked images in the processed image block set;
step S308, parameter adjustment learning is carried out on the mapped image blocks and the marked images, and parameters of a deep learning network are obtained;
after loading the training images of the complete batch, determining that one training round is completed, and updating the training round number, namely adding 1 to the epoch (i.e. step S310);
step S312, obtaining an index of the training image, and performing random sorting processing on the index by using a shuffle module;
step S314, after the random sorting process, a corresponding training image set is obtained, and batch processing is carried out on the image training set to obtain a plurality of batches of training images.
In the embodiment, patch segmentation is performed according to the preset sliding step length and block size, so that the problems of pixel loss and precision reduction caused by the need of carrying out size normalization on an image block are solved, the precision of feature local extraction in deep learning training is ensured, and the accuracy of a recognition result is ensured; and firstly loading the training image and then carrying out patch segmentation, thereby avoiding the condition of carrying out corresponding patch segmentation on the marked image, reducing the time of reconstructing, offline storing, preprocessing and the like of the training set based on the patch, improving the training efficiency and saving the space required by training.
It should be understood that, although the steps in the flowcharts of fig. 2-3 are shown in order as indicated by the arrows, these steps are not necessarily performed in order as indicated by the arrows. The steps are not strictly limited to the order of execution unless explicitly recited herein, and the steps may be executed in other orders. Moreover, at least some of the steps in fig. 2-3 may include multiple steps or stages that are not necessarily performed at the same time, but may be performed at different times, nor does the order in which the steps or stages are performed necessarily performed in sequence, but may be performed alternately or alternately with at least a portion of the steps or stages in other steps or other steps.
In one embodiment, as shown in fig. 4, there is provided a training apparatus 400 of a deep learning network, comprising: an image loading module 402, a block segmentation module 404, a mapping processing module 406, and a parameter adjustment learning module 408, wherein:
an image loading module 402 for loading training images and marker images; the marking image is obtained by marking the features in the training image;
the block segmentation module 404 is configured to segment the training image according to a preset segmentation size to obtain a plurality of image blocks;
a mapping processing module 406, configured to perform a feature extraction process on the plurality of image blocks, and then perform a mapping process on the plurality of processed image blocks and the marker image;
the parameter adjustment learning module 408 is configured to perform parameter adjustment learning on the mapped image block and the marked image to obtain parameters of the deep learning network.
In one embodiment, when the training images are multiple, each training image corresponds to a different set of image blocks, and each set of image blocks includes the same number of image blocks.
In one embodiment, the block segmentation module 404 is further configured to obtain a preset sliding step size and a block size; and performing sliding segmentation processing on the training image according to the sliding step length and the block size to obtain a plurality of image blocks.
In one embodiment, when the training images are multiple, each training image corresponds to a different set of image blocks, and the size of the spliced image blocks in each set of image blocks is the same as the size of the training image before segmentation.
In one embodiment, the training apparatus 400 of the deep learning network further includes: the first module of sequencing processing is used for acquiring a plurality of training images; carrying out random sorting processing on a plurality of training images by utilizing a shuffle module; the batch classification module is used for classifying batches of training images after the random sorting processing to obtain a plurality of batches of training images; and the image loading module is used for loading the training images in batches for training.
In one embodiment, the training apparatus 400 of the deep learning network further includes: the training round number determining module is used for determining that one round of training is completed after training is performed by loading training images of each batch; and the sorting processing second module is used for carrying out random sorting processing on indexes of the plurality of training images by utilizing the shuffle module and carrying out next training.
In one embodiment, the training round number determining module is further configured to update the training round number; and the third sorting processing module is used for carrying out random sorting processing on indexes of a plurality of training images by utilizing the shuffle module and carrying out next round of training if the number of training rounds does not reach the preset number of rounds.
For specific limitations on the training apparatus of the deep learning network, reference may be made to the above limitation on the training method of the deep learning network, and no further description is given here. The above-mentioned respective modules in the training apparatus of the deep learning network may be implemented in whole or in part by software, hardware, and a combination thereof. The above modules may be embedded in hardware or may be independent of a processor in the computer device, or may be stored in software in a memory in the computer device, so that the processor may call and execute operations corresponding to the above modules.
In one embodiment, a computer device is provided comprising a memory and a processor, the memory having stored therein a computer program, the processor when executing the computer program performing the steps of:
loading a training image and a marking image; the marking image is obtained by marking the feature in the training image;
according to a preset block size, performing block segmentation on the training image to obtain a plurality of image blocks;
after the feature extraction processing is carried out on the plurality of image blocks, mapping processing is carried out on the plurality of processed image blocks and the marked image;
and carrying out parameter adjustment learning on the mapped image blocks and the marked images to obtain parameters of the deep learning network.
In one embodiment, when the training images are multiple, each training image corresponds to a different set of image blocks, and each set of image blocks includes the same number of image blocks.
In one embodiment, the processor when executing the computer program further performs the steps of: acquiring a preset sliding step length and a preset block size; and performing sliding segmentation processing on the training image according to the sliding step length and the block size to obtain a plurality of image blocks.
In one embodiment, when the training images are multiple, each training image corresponds to a different set of image blocks, and the size of the spliced image blocks in each set of image blocks is the same as the size of the training image before segmentation.
In one embodiment, the processor when executing the computer program further performs the steps of: acquiring a plurality of training images; carrying out random sorting processing on a plurality of training images by utilizing a shuffle module; carrying out batch classification on the training images subjected to the random sorting treatment to obtain a plurality of batches of training images; and loading training images in batches for training.
In one embodiment, the processor when executing the computer program further performs the steps of: if training images of each batch are loaded for training, determining that one round of training is completed; and carrying out random sorting processing on indexes of a plurality of training images by utilizing a shuffle module, and carrying out the next training.
In one embodiment, the processor when executing the computer program further performs the steps of: updating the training round number; if the training round number does not reach the preset round number, the index of the plurality of training images is randomly ordered by using the shuffle module, and the next round of training is performed.
In one embodiment, a computer readable storage medium is provided having a computer program stored thereon, which when executed by a processor, performs the steps of:
loading a training image and a marking image; the marking image is obtained by marking the feature in the training image;
according to a preset block size, performing block segmentation on the training image to obtain a plurality of image blocks;
after the feature extraction processing is carried out on the plurality of image blocks, mapping processing is carried out on the plurality of processed image blocks and the marked image;
and carrying out parameter adjustment learning on the mapped image blocks and the marked images to obtain parameters of the deep learning network.
In one embodiment, when the training images are multiple, each training image corresponds to a different set of image blocks, and each set of image blocks includes the same number of image blocks.
In one embodiment, the processor when executing the computer program further performs the steps of: acquiring a preset sliding step length and a preset block size; and performing sliding segmentation processing on the training image according to the sliding step length and the block size to obtain a plurality of image blocks.
In one embodiment, when the training images are multiple, each training image corresponds to a different set of image blocks, and the size of the spliced image blocks in each set of image blocks is the same as the size of the training image before segmentation.
In one embodiment, the processor when executing the computer program further performs the steps of: acquiring a plurality of training images; carrying out random sorting processing on a plurality of training images by utilizing a shuffle module; carrying out batch classification on the training images subjected to the random sorting treatment to obtain a plurality of batches of training images; and loading training images in batches for training.
In one embodiment, the processor when executing the computer program further performs the steps of: if training images of each batch are loaded for training, determining that one round of training is completed; and carrying out random sorting processing on indexes of a plurality of training images by utilizing a shuffle module, and carrying out the next training.
In one embodiment, the processor when executing the computer program further performs the steps of: updating the training round number; if the training round number does not reach the preset round number, the index of the plurality of training images is randomly ordered by using the shuffle module, and the next round of training is performed.
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 used in embodiments provided herein may include at least one of non-volatile and volatile memory. The nonvolatile Memory may include Read-Only Memory (ROM), magnetic tape, floppy disk, flash Memory, optical Memory, or the like. Volatile memory can include random access memory (Random Access Memory, RAM) or external cache memory. By way of illustration, and not limitation, RAM can be in the form of a variety of forms, such as static random access memory (Static Random Access Memory, SRAM) or dynamic random access memory (Dynamic Random Access Memory, DRAM), and the like.
The technical features of the above embodiments may be arbitrarily combined, and all possible combinations of the technical features in the above embodiments are not described for brevity of description, however, as long as there is no contradiction between the combinations of the technical features, they should be considered as the scope of the description.
The above examples illustrate only a few embodiments of the application, which are described in detail and are not to be construed as limiting the scope of the application. It should be noted that it will be apparent to those skilled in the art that several variations and modifications can be made without departing from the spirit of the application, which are all within the scope of the application. Accordingly, the scope of protection of the present application is to be determined by the appended claims.

Claims (10)

1. A training method of a deep learning network, comprising:
loading the training image and the marker image into a deep learning network; the marking image is obtained by marking the feature in the training image;
in the deep learning network, according to a preset block size, performing block segmentation on the training image to obtain a plurality of image blocks;
in the deep learning network, performing feature extraction processing on the plurality of image blocks, and performing mapping processing on the plurality of processed image blocks and the marker image after the feature extraction processing, so that each image block derived from the training image and the marker image corresponding to the training image form a mapping relation;
and in the deep learning network, performing parameter adjustment learning on the mapped image blocks and the marked images to obtain parameters of the deep learning network.
2. The method of claim 1, wherein when the training images are plural, each training image corresponds to a different set of image blocks, and each set of image blocks includes the same number of image blocks.
3. The method according to claim 1, wherein the step of performing block segmentation on the training image in the deep learning network according to a preset block size to obtain a plurality of image blocks includes:
acquiring a preset sliding step length and the block size;
and in the deep learning network, performing sliding segmentation processing on the training image according to the sliding step length and the block size to obtain a plurality of image blocks.
4. A method according to claim 3, wherein when the training images are plural, each training image corresponds to a different set of image blocks, and the image blocks in each set of image blocks are spliced to obtain a splice size identical to the size of the training image before segmentation.
5. The method of claim 1, further comprising, prior to loading the training image and the marker image into a deep learning network:
acquiring a plurality of training images;
carrying out random sorting processing on a plurality of training images by utilizing a shuffle module;
carrying out batch classification on the training images subjected to the random sorting treatment to obtain a plurality of batches of training images;
and loading training images in batches for training.
6. The method as recited in claim 5, further comprising:
if training images of each batch are loaded for training, determining that one round of training is completed;
and carrying out random sorting processing on indexes of the training images by utilizing a shuffle module, and carrying out next training.
7. The method of claim 6, further comprising, after the step of determining that a round of training is completed:
updating the training round number;
and if the training round number does not reach the preset round number, carrying out random sorting processing on indexes of a plurality of training images by utilizing a shuffle module, and carrying out next round of training.
8. A training apparatus for a deep learning network, comprising:
the image loading module is used for loading the training image and the marker image into the deep learning network; the marking image is obtained by marking the features in the training image;
the block segmentation module is used for carrying out block segmentation on the training image in the deep learning network according to a preset segmentation size to obtain a plurality of image blocks;
the mapping processing module is used for performing feature extraction processing on the image blocks in the deep learning network, and performing mapping processing on the processed image blocks and the marker images after the feature extraction processing so that each image block from the training image and the marker image corresponding to the training image form a mapping relation;
and the parameter adjustment learning module is used for carrying out parameter adjustment learning on the image block and the marked image after the mapping processing in the deep learning network to obtain parameters of the deep learning network.
9. 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 7 when the computer program is executed.
10. 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 7.
CN202010146486.5A 2020-03-05 2020-03-05 Training method and device for deep learning network, computer equipment and storage medium Active CN111325281B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010146486.5A CN111325281B (en) 2020-03-05 2020-03-05 Training method and device for deep learning network, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010146486.5A CN111325281B (en) 2020-03-05 2020-03-05 Training method and device for deep learning network, computer equipment and storage medium

Publications (2)

Publication Number Publication Date
CN111325281A CN111325281A (en) 2020-06-23
CN111325281B true CN111325281B (en) 2023-10-27

Family

ID=71173168

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010146486.5A Active CN111325281B (en) 2020-03-05 2020-03-05 Training method and device for deep learning network, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN111325281B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114155555B (en) * 2021-12-02 2022-06-10 北京中科智易科技有限公司 Human behavior artificial intelligence judgment system and method

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105551036A (en) * 2015-12-10 2016-05-04 中国科学院深圳先进技术研究院 Training method and device for deep learning network
CN109427052A (en) * 2017-08-29 2019-03-05 ***通信有限公司研究院 Correlation technique and equipment based on deep learning processing eye fundus image
WO2019049060A1 (en) * 2017-09-08 2019-03-14 Stone Three Mining Solutions (Pty) Ltd Froth segmentation in flotation cells
CN109859203A (en) * 2019-02-20 2019-06-07 福建医科大学附属口腔医院 Defect dental imaging recognition methods based on deep learning
CN109993197A (en) * 2018-12-07 2019-07-09 天津大学 A kind of zero sample multi-tag classification method based on the end-to-end example differentiation of depth
CN110309855A (en) * 2019-05-30 2019-10-08 上海联影智能医疗科技有限公司 Training method, computer equipment and the storage medium of image segmentation
CN110335199A (en) * 2019-07-17 2019-10-15 上海骏聿数码科技有限公司 A kind of image processing method, device, electronic equipment and storage medium
CN110827330A (en) * 2019-10-31 2020-02-21 河海大学 Time sequence integrated multispectral remote sensing image change detection method and system

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10817758B2 (en) * 2018-06-20 2020-10-27 International Business Machines Corporation Framework for integrating deformable modeling with 3D deep neural network segmentation

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105551036A (en) * 2015-12-10 2016-05-04 中国科学院深圳先进技术研究院 Training method and device for deep learning network
CN109427052A (en) * 2017-08-29 2019-03-05 ***通信有限公司研究院 Correlation technique and equipment based on deep learning processing eye fundus image
WO2019049060A1 (en) * 2017-09-08 2019-03-14 Stone Three Mining Solutions (Pty) Ltd Froth segmentation in flotation cells
CN109993197A (en) * 2018-12-07 2019-07-09 天津大学 A kind of zero sample multi-tag classification method based on the end-to-end example differentiation of depth
CN109859203A (en) * 2019-02-20 2019-06-07 福建医科大学附属口腔医院 Defect dental imaging recognition methods based on deep learning
CN110309855A (en) * 2019-05-30 2019-10-08 上海联影智能医疗科技有限公司 Training method, computer equipment and the storage medium of image segmentation
CN110335199A (en) * 2019-07-17 2019-10-15 上海骏聿数码科技有限公司 A kind of image processing method, device, electronic equipment and storage medium
CN110827330A (en) * 2019-10-31 2020-02-21 河海大学 Time sequence integrated multispectral remote sensing image change detection method and system

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
基于多尺度卷积神经网络的场景标记;尹蕊;;现代计算机(专业版)(第06期);全文 *

Also Published As

Publication number Publication date
CN111325281A (en) 2020-06-23

Similar Documents

Publication Publication Date Title
Darlow et al. Cinic-10 is not imagenet or cifar-10
CN111310775B (en) Data training method, device, terminal equipment and computer readable storage medium
CN111680701B (en) Training method and device of image recognition model and image recognition method and device
CN112183295A (en) Pedestrian re-identification method and device, computer equipment and storage medium
CN113344910B (en) Defect labeling image generation method and device, computer equipment and storage medium
EP3859479A1 (en) Method for determining distribution information, and control method and device for unmanned aerial vehicle
CN113222055B (en) Image classification method and device, electronic equipment and storage medium
CN111325281B (en) Training method and device for deep learning network, computer equipment and storage medium
CN110969046A (en) Face recognition method, face recognition device and computer-readable storage medium
CN111179270A (en) Image co-segmentation method and device based on attention mechanism
CN112241646A (en) Lane line recognition method and device, computer equipment and storage medium
CN111931799A (en) Image recognition method and device
CN115578590A (en) Image identification method and device based on convolutional neural network model and terminal equipment
DE102019209562B4 (en) Device and method for training a neural network and device and method for validating a neural network
CN112766351A (en) Image quality evaluation method, system, computer equipment and storage medium
CN116704281A (en) Model training method, device, image recognition method and computer equipment
CN110929792A (en) Image annotation method and device, electronic equipment and storage medium
CN110555344A (en) Lane line recognition method, lane line recognition device, electronic device, and storage medium
CN113657444A (en) Interface element identification method and system
CN112288748A (en) Semantic segmentation network training and image semantic segmentation method and device
CN110633740A (en) Image semantic matching method, terminal and computer-readable storage medium
CN113111921B (en) Object identification method, device, electronic equipment and storage medium
CN111489359B (en) Image segmentation method and device
CN116704008B (en) Method and device for judging object based on picture area calculation and application of method and device
CN116205916B (en) Method and device for detecting defects of small electric power sample, computer equipment and storage medium

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