[go: up one dir, main page]
More Web Proxy on the site http://driver.im/

CN110619600A - Neural network model training method and device, storage medium and electronic equipment - Google Patents

Neural network model training method and device, storage medium and electronic equipment Download PDF

Info

Publication number
CN110619600A
CN110619600A CN201910876941.4A CN201910876941A CN110619600A CN 110619600 A CN110619600 A CN 110619600A CN 201910876941 A CN201910876941 A CN 201910876941A CN 110619600 A CN110619600 A CN 110619600A
Authority
CN
China
Prior art keywords
sample image
neural network
mark frame
preset
network model
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.)
Granted
Application number
CN201910876941.4A
Other languages
Chinese (zh)
Other versions
CN110619600B (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.)
Xuzhou Kuang Shi Data Technology Co Ltd
Nanjing Kuanyun Technology Co Ltd
Beijing Megvii Technology Co Ltd
Original Assignee
Xuzhou Kuang Shi Data Technology Co Ltd
Nanjing Kuanyun Technology Co Ltd
Beijing Megvii Technology 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 Xuzhou Kuang Shi Data Technology Co Ltd, Nanjing Kuanyun Technology Co Ltd, Beijing Megvii Technology Co Ltd filed Critical Xuzhou Kuang Shi Data Technology Co Ltd
Priority to CN201910876941.4A priority Critical patent/CN110619600B/en
Publication of CN110619600A publication Critical patent/CN110619600A/en
Application granted granted Critical
Publication of CN110619600B publication Critical patent/CN110619600B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • 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
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T3/00Geometric image transformations in the plane of the image
    • G06T3/04Context-preserving transformations, e.g. by using an importance map
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/10Image acquisition modality
    • G06T2207/10004Still image; Photographic image
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20081Training; Learning

Landscapes

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

Abstract

The present disclosure relates to the field of image processing technologies, and in particular, to a neural network model training method and apparatus, a computer-readable storage medium, and an electronic device, where the method includes: acquiring a sample image; when the sample image is a sample image with a preset mark frame, determining whether to process the sample image according to a preset rule; when the sample image is determined to be processed, processing the sample image according to the preset mark frame; and training the neural network to be trained according to the processed sample image to obtain the neural network model. According to the technical scheme of the embodiment of the disclosure, the main object area in the sample image can be enhanced, the interference of other areas of the sample image on the main object area of the sample image is avoided, and the accuracy of the trained neural network model is improved.

Description

Neural network model training method and device, storage medium and electronic equipment
Technical Field
The present disclosure relates to the field of image processing technologies, and in particular, to a neural network model training method and apparatus, a computer-readable storage medium, and an electronic device.
Background
With the continuous development of artificial intelligence, more and more intelligent models are continuously applied to various fields. Image enhancement is an extremely important step in training neural network models that process images. When the number of samples is insufficient, the problem of overfitting can be avoided by using an image enhancement technology; when the number of samples is sufficient, the accuracy of the trained model can be improved by using the image enhancement technology.
The current image enhancement technology mainly comprises the following strategies: one is to enhance the sample image using geometric transformations, such as translation, rotation, scaling, etc.; secondly, enhancing the sample image by random brightness adjustment; and thirdly, enhancing the sample image by using random cutting. However, when the sample image is relatively complex, the three enhancement strategies cannot remove the interference of other regions in the sample image on the main object region, so that the accuracy of the trained neural network model is low.
It is to be noted that the information disclosed in the above background section is only for enhancement of understanding of the background of the present disclosure, and thus may include information that does not constitute prior art known to those of ordinary skill in the art.
Disclosure of Invention
The present disclosure aims to provide a neural network model training method and apparatus, a computer-readable storage medium, and an electronic device, so as to overcome, at least to a certain extent, the problem of low accuracy of a trained neural network model caused by failure to remove interference of other regions in a sample image on a main object region.
Additional features and advantages of the disclosure will be set forth in the detailed description which follows, or in part will be obvious from the description, or may be learned by practice of the disclosure.
According to a first aspect of the present disclosure, there is provided a neural network model training method, including:
acquiring a sample image;
when the sample image is a sample image with a preset mark frame, determining whether to process the sample image according to a preset rule;
when the sample image is determined to be processed, processing the sample image according to the preset mark frame;
and training the neural network to be trained according to the processed sample image to obtain the neural network model.
In an exemplary embodiment of the present disclosure, based on the foregoing scheme, the processing the sample image according to the preset mark frame includes:
and cutting the sample image according to the preset mark frame to obtain the processed sample image.
In an exemplary embodiment of the present disclosure, based on the foregoing scheme, the processing the sample image according to the preset mark frame includes:
zooming the preset mark frame according to a preset proportion to obtain a zoomed mark frame;
and cutting the sample image according to the scaled marking frame to obtain the processed sample image.
In an exemplary embodiment of the present disclosure, based on the foregoing scheme, the processing the sample image according to the preset mark frame further includes:
acquiring the vertex of a preset mark frame in the sample image;
disturbing the vertex of the preset mark frame to obtain a disturbed mark frame;
and cutting the sample image according to the disturbed mark frame to obtain the processed sample image.
In an exemplary embodiment of the disclosure, based on the foregoing scheme, the determining whether to process the sample image according to a preset rule includes:
generating a random number;
and determining whether to process the sample image according to the random number.
In an exemplary embodiment of the disclosure, based on the foregoing scheme, the determining whether to process the sample image according to the random number includes:
when the random number is greater than or equal to a preset threshold value, determining to process the sample image;
and when the random number is smaller than the preset threshold value, determining not to process the sample image.
In an exemplary embodiment of the present disclosure, based on the foregoing scheme, the method further includes:
and training the neural network to be trained according to the sample image.
In an exemplary embodiment of the present disclosure, based on the foregoing, the method further includes at least one or more of the following steps:
geometrically transforming the sample image;
adjusting the brightness of the sample image; and
and clipping the sample image.
According to a second aspect of the present disclosure, there is provided a neural network model training apparatus, the apparatus including:
the acquisition module is used for acquiring a sample image;
the first processing module is used for determining whether to process the sample image according to a preset rule when the sample image is the sample image with a preset mark frame;
the second processing module is used for processing the sample image according to the preset mark frame when the sample image is determined to be processed;
and the training module is used for training the neural network to be trained according to the processed sample image to obtain the neural network model.
According to a third aspect of the present disclosure, there is provided a computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements the neural network model training method as described in the first aspect of the embodiments above.
According to a fourth aspect of the embodiments of the present disclosure, there is provided an electronic apparatus including:
a processor; and
a storage device for storing one or more programs which, when executed by the one or more processors, cause the one or more processors to implement the neural network model training method as described in the first aspect of the embodiments above.
The technical scheme provided by the embodiment of the disclosure can have the following beneficial effects:
in the neural network model training method provided by one embodiment of the disclosure, a sample image is obtained, and when the sample image is a sample image with a preset mark frame, whether the sample image is processed or not is determined according to a preset rule; when the sample image is determined to be processed, processing the sample image according to the preset mark frame; and training the neural network to be trained according to the processed sample image to obtain the neural network model. According to the technical scheme, the sample image is processed by using the preset mark frame, the main object area in the sample image can be enhanced, interference of other areas of the sample image on the main object area of the sample image is avoided, and the accuracy of the trained neural network model is improved.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and together with the description, serve to explain the principles of the disclosure. It is to be understood that the drawings in the following description are merely exemplary of the disclosure, and that other drawings may be derived from those drawings by one of ordinary skill in the art without the exercise of inventive faculty. In the drawings:
FIG. 1 schematically illustrates a flow chart of a neural network model training method in an exemplary embodiment of the present disclosure;
fig. 2 schematically illustrates a flowchart of a method of determining whether to process the sample image according to a preset rule in an exemplary embodiment of the present disclosure;
FIG. 3 schematically illustrates a flow chart of a method of determining whether to process the sample image based on the random number in an exemplary embodiment of the disclosure;
FIG. 4 is a flow chart schematically illustrating another method for processing the sample image according to the preset mark frame in an exemplary embodiment of the present disclosure;
FIG. 5 is a flow chart schematically illustrating another method for processing the sample image according to the preset mark frame in an exemplary embodiment of the present disclosure;
FIG. 6 schematically illustrates a flow chart of a neural network model training method, exemplifying geometric transformations performed on sample images that are not processed, in an exemplary embodiment of the disclosure;
FIG. 7 is a schematic diagram illustrating a sample image and a pre-set marker box in an exemplary embodiment of the present disclosure;
FIG. 8 shows a schematic view of a processed sample image in an exemplary embodiment of the present disclosure;
FIG. 9 is a schematic diagram illustrating another sample image and a preset mark frame in an exemplary embodiment of the present disclosure;
FIG. 10 shows a schematic view of a sample image after another processing in an exemplary embodiment of the present disclosure;
FIG. 11 is a schematic diagram illustrating a sample image and a perturbed marker box in an exemplary embodiment of the present disclosure;
FIG. 12 shows a schematic view of a sample image after further processing in an exemplary embodiment of the present disclosure;
FIG. 13 is a schematic diagram illustrating an exemplary implementation of a neural network model training apparatus according to an exemplary embodiment of the disclosure;
FIG. 14 schematically illustrates a structural diagram of a computer system suitable for use with an electronic device that implements an exemplary embodiment of the present disclosure;
fig. 15 schematically illustrates a schematic diagram of a computer-readable storage medium, according to some embodiments of the present disclosure.
Detailed Description
Example embodiments will now be described more fully with reference to the accompanying drawings. Example embodiments may, however, be embodied in many different forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the concept of example embodiments to those skilled in the art. The described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments.
Furthermore, the drawings are merely schematic illustrations of the present disclosure and are not necessarily drawn to scale. The same reference numerals in the drawings denote the same or similar parts, and thus their repetitive description will be omitted. Some of the block diagrams shown in the figures are functional entities and do not necessarily correspond to physically or logically separate entities. These functional entities may be implemented in the form of software, or in one or more hardware modules or integrated circuits, or in different networks and/or processor devices and/or microcontroller devices.
In the present exemplary embodiment, a neural network model training method is first provided, which may be applied to a training process of a neural network model that processes an image, for example, a training process for a convolutional neural network model. Referring to fig. 1, the neural network model training method may include the following steps:
s110, obtaining a sample image;
s120, when the sample image is a sample image with a preset mark frame, determining whether to process the sample image according to a preset father and son;
s130, when the sample image is determined to be processed, processing the sample image according to the preset mark frame;
and S140, training the neural network to be trained according to the processed sample image to obtain the neural network model.
According to the neural network model training method provided in the exemplary embodiment, the sample image is processed by using the preset mark frame, so that the main object region in the sample image can be enhanced, interference of other regions of the sample image on the main object region of the sample image is avoided, and the accuracy of the trained neural network model is improved.
Hereinafter, the steps of the neural network model training method in the present exemplary embodiment will be described in more detail with reference to the drawings and the embodiments.
In an example embodiment of the present disclosure, a sample set for model training includes a portion of sample images with a preset mark frame and a portion of sample images without a preset mark frame. The method comprises the steps that a sample image with a preset mark frame is arranged at a fixed position of the sample image, and the preset mark frame is used for enabling the sample image to contain a main object area circle needing to be identified. The shape of the preset mark frame can be various figures such as a circle, a triangle, a rectangle and the like, the preset mark frame can be obtained by manually marking the sample image, or the preset mark frame can be obtained by detecting the sample image through a preset image detection model, and the shape of the preset mark frame is not specially limited in the disclosure.
In step S110, a sample image is acquired.
In an example embodiment of the present disclosure, when training a neural network to be trained, a sample image needs to be acquired from the sample set. Since the sample set includes a part of the sample image with the preset mark frame and a part of the sample image without the preset mark frame, the sample image acquired at this time may or may not have the preset mark frame.
In step S120, when the sample image is a sample image with a preset mark frame, it is determined whether to process the sample image according to a preset rule.
In an example embodiment of the present disclosure, before each sample image with a preset mark frame is acquired for training, it is required to determine whether to process the sample image with the preset mark frame according to a preset rule. The preset rule can be a self-defined rule for randomly selecting between the two rules, and a developer can perform specific setting according to the training requirements of each neural network model. The preset mark frame can be selectively used for the sample image through the preset rule, and the problem that the main object area and other areas of the sample image cannot be distinguished by the trained neural network model caused by training by completely using the processed sample image is avoided.
Specifically, a random number rule may be selected as the preset rule. At this time, the determining whether to process the sample image according to the preset rule, as shown in fig. 2, includes the following steps S210 to S220:
step S210, generating a random number according to a preset algorithm.
In an example embodiment of the present disclosure, the preset algorithm may be a customized algorithm for generating random numbers. And each sample image with the preset mark frame is obtained, a corresponding random number is generated according to a preset algorithm, and whether the sample image is processed or not is judged according to the random number.
Step S220, determining whether to process the sample image according to the random number.
In an example embodiment of the present disclosure, whether to process the sample image may be determined according to a magnitude relationship between the random number and a preset threshold, specifically, as shown in fig. 3, the method may include steps S310 to S320:
and step S310, when the random number is greater than or equal to a preset threshold value, determining to process the sample image.
And step S330, determining not to process the sample image when the random number is smaller than the preset threshold value.
In an example embodiment of the present disclosure, one generation range may be set for random numbers, and all the generated random numbers are numerical values in the generation range. At this time, the preset threshold may select any one of the values within the generation range. For example, a random number with a value range of [0,1] may be generated, and the preset threshold may be set to 0.5.
Further, when the random number is greater than or equal to the preset threshold value, determining to process the sample image; and when the random number is smaller than the preset threshold value, determining not to process the sample image. For example, if the random number generation range is [0,1], the preset threshold is 0.5, and the random number generated when the sample image 1 is acquired is 0.6, it can be determined that the sample image 1 is processed. Under the setting, the larger the value of the preset threshold value is, the smaller the possibility of processing the sample image with the preset mark frame is; conversely, the smaller the value of the preset threshold is, the higher the possibility that the sample image with the preset mark frame is processed is. The probability of processing in the sample image with the preset mark frame can be controlled through the random number rule, and the situation that the input of the sample image of the neural network to be trained is not controlled is avoided.
In an example embodiment of the present disclosure, when determining whether to process the sample image according to the random number, the determination may also be made according to other characteristics of the random number, which is not particularly limited by the present disclosure. For example, when the random number is singular, it is determined that the sample image is processed; and when the random number is a double number, determining not to process the sample image.
Continuing to refer to fig. 1, in step S130, when it is determined to process the sample image, the sample image is processed according to the preset mark frame.
In an example embodiment of the present disclosure, the processing the sample image according to the preset mark frame includes: and cutting the sample image according to the preset mark frame to obtain the processed sample image.
In an example embodiment of the present disclosure, when determining to process the sample image, first, a preset mark frame bound to the sample image needs to be obtained. Specifically, position data for determining the position of the preset mark frame in the sample image may be obtained first, and then the corresponding preset mark frame may be obtained according to the position data. For example, the shape and size of the preset mark frame and the position coordinates of any preset point, or the coordinates of each vertex of the preset mark frame, or the position data such as the pixel coordinates included in the preset mark frame may be obtained first, and then the bound preset mark frame may be determined in the sample image according to the position data.
Further, after a preset mark frame bound with the sample image is obtained, a main object area of the sample image in a preset mark frame circle is cut out, and the main object area is independently used as input to train a neural network model. For example, when the preset mark frame is rectangular, the main object region including the main object (right bird) in the sample image may be separately cropped out through the rectangular preset mark frame, the sample image and the bound preset mark frame are as shown in fig. 7, and the cropped processed sample image is as shown in fig. 8.
The neural network model is trained according to the main object area in the preset mark frame circle, the main object area without other objects can be used as input for training in the training process, the interference of other objects on the main object is avoided, and the accuracy of the trained neural network model is improved.
Further, in an example embodiment of the present disclosure, the processing the sample image according to the preset mark frame, as shown in fig. 4, includes the following steps S410 to S420:
s410, zooming the preset mark frame according to a preset proportion to obtain a zoomed mark frame;
and step S420, cutting the sample image according to the zoomed marking frame to obtain the processed sample image.
In an example embodiment of the present disclosure, in order to enrich a processing result of the preset mark frame, the preset proportion may be customized, and the preset mark frame is zoomed according to the preset proportion, and then is cut according to the zoomed preset mark frame, so as to obtain a processed sample image. Specifically, the preset ratio may be set to 1.2, and the preset mark frame is enlarged by 1.2 times based on the central coordinate of the preset mark frame, as shown in fig. 9; subsequently, the processed sample image is cut out according to the enlarged preset mark frame, as shown in fig. 10.
When the long-range image is identified, a part of environment image where the main object is located can be cut out by setting a preset proportion, and the main object is identified in an auxiliary mode. For example, when a lion with a long-range view is recognized, since the lion generally lives in a natural environment, it is possible to assist in recognizing whether or not the main subject is a lion from an ambient image.
When the main object with obvious features is identified, a part of the main object can be cut out through the preset proportion, and the neural network model can be trained to identify the main object according to the obvious features. For example, when the elephant is recognized, the nose of the elephant is cut out through a preset proportion, and the trained neural network model can determine that the main object is the elephant according to the nose of the elephant.
In an example embodiment of the present disclosure, when the preset mark frame is a non-circular rectangle, a square, or another graph having vertices, the processing of the sample image according to the preset mark frame further includes the following steps S510 to S530, as shown in fig. 5:
step S510, a vertex of a preset mark frame in the sample image is obtained.
And S520, disturbing the vertex of the preset mark frame according to a preset random disturbance algorithm to obtain a disturbed mark frame.
Step S530, clipping the sample image according to the disturbed mark frame to obtain the processed sample image.
In an example embodiment of the present disclosure, in order to enrich processing results of the preset mark frame, the vertices of the preset mark frame may be respectively subjected to random disturbance according to a preset random disturbance algorithm, the disturbed mark frame is obtained according to the disturbed vertices, and the disturbed mark frame is cut to obtain the processed sample image. Specifically, a random offset value with a value of [ -1,1] can be set and generated, the vertex coordinates are randomly disturbed to obtain disturbed vertex coordinates, and the disturbed mark frame is determined according to the vertex coordinates. For example, when the preset mark frame is rectangular, 4 vertices of the preset mark frame may be randomly disturbed to obtain a disturbed mark frame (see fig. 11), and the processed sample image may be obtained by clipping, as shown in fig. 12. Similarly, the processing result of the preset mark frame can be enriched by setting the preset random disturbance rule, an environment image where a certain main object is located can be cut out to assist in recognizing the main object, certain features can be cut out, and the neural network to be trained is trained to recognize the main object according to the certain features.
Continuing to refer to fig. 1, in step S140, a neural network to be trained is trained according to the processed sample image, so as to obtain the neural network model.
In an example embodiment of the present disclosure, for a processed sample image, the processed sample image may be used as an input to train a neural network to be trained, so as to obtain a trained neural network model.
Upon determining not to use a preset marker box for the sample image, the method further comprises: and training the neural network to be trained according to the sample image.
In an example embodiment of the disclosure, when the obtained sample image is a sample image with a preset mark frame, whether to perform processing is determined according to a preset rule, if the processing is performed, the processed sample image is used as an input of a neural network to be trained, and if the processing is not performed, the sample image can be directly input into the neural network to be trained. The specific way of training the neural network to be trained according to the sample image or the processed sample image may be performed according to the training way of the neural network to be trained itself, which is not limited in this disclosure. For example, in a supervised convolutional neural network, parameters in the convolutional neural network may be adjusted in units of at least one input (sample image or processed sample image) until the output result error is less than a desired value.
In an example embodiment of the present disclosure, when it is determined not to process the sample image, in addition to training the image model directly using the sample image as an input, the method further comprises at least one or more of the following steps: performing geometric transformation on the sample image, performing brightness adjustment on the sample image, and cropping the sample image. Wherein the geometric transformation may include rotation, scaling, and the like. For example, when it is determined that the preset mark frame is not used for the sample image, the sample image may be rotated, and the rotated sample image may be used as an input to train the neural network to be trained.
The following describes details of implementation of the technical solution of the embodiment of the present disclosure in detail with reference to fig. 6, which is an example of geometric transformation of a sample image that is not processed:
in step S610, a sample image is acquired,
step S620, when the sample image is a sample image with a preset mark frame, generating a random number with a value range of [0,1 ];
step S630, judging whether to process the sample image according to the random number and the size of a preset threshold value of 0.5;
step 640, when the sample image is determined to be processed, cutting the sample image according to a preset mark frame to obtain a processed sample image;
step S650, when the sample image is determined not to be processed, performing geometric transformation on the sample image to obtain a transformed sample image;
and 660, training the neural network to be trained according to the processed sample image or the transformed sample image.
According to the neural network model training method provided by the disclosure, when an image model of bird classification is trained, Resnet50 and Resnet101 are selected as neural network models to be trained, the accuracy of the neural network model obtained by training by using the technical scheme of the disclosure is improved compared with the accuracy when the neural network model is not used, and specific data are shown in table 1:
TABLE 1 accuracy data for neural network models
Method of producing a composite material Accuracy (%)
Resnet 50 70.11
Resnet50 (training method using neural network model of the present disclosure) 80.69
Resnet 101 77.25
Resnet101 (training method using neural network model of the present disclosure) 82.54
It is noted that the above-mentioned figures are merely schematic illustrations of processes involved in methods according to exemplary embodiments of the present disclosure, and are not intended to be limiting. It will be readily understood that the processes shown in the above figures are not intended to indicate or limit the chronological order of the processes. In addition, it is also readily understood that these processes may be performed synchronously or asynchronously, e.g., in multiple modules.
In addition, in an exemplary embodiment of the present disclosure, a neural network model training apparatus is also provided. Referring to fig. 13, the neural network model training 1300 includes: an acquisition module 1310, a first processing module 1320, a second processing module 1330, and a training module 1340.
Wherein the obtaining module 1310 may be configured to obtain a sample image;
the first processing module 1320 may be configured to determine whether to process the sample image according to a preset rule when the sample image is a sample image with a preset mark frame;
the second processing module 1330 may be configured to, when it is determined to process the sample image, process the sample image according to the preset mark frame;
the training module 1340 may be configured to train a neural network to be trained according to the processed sample image, so as to obtain the neural network model.
In an exemplary embodiment of the present disclosure, based on the foregoing scheme, the second processing module 1330 may be configured to crop the sample image according to the preset mark frame, so as to obtain the processed sample image.
In an exemplary embodiment of the present disclosure, based on the foregoing scheme, the second processing module 1330 may be configured to scale the preset mark frame according to a preset ratio, so as to obtain a scaled mark frame; and cutting the sample image according to the scaled marking frame to obtain the processed sample image.
In an exemplary embodiment of the disclosure, based on the foregoing solution, the second processing module 1330 may be configured to obtain a vertex of a preset mark frame in the sample image; disturbing the vertex of the preset mark frame according to a preset random disturbance algorithm to obtain a disturbed mark frame; and cutting the sample image according to the disturbed mark frame to obtain the processed sample image.
In an exemplary embodiment of the present disclosure, based on the foregoing scheme, the first processing module 1320 may be configured to generate a random number according to a preset algorithm; and determining whether to process the sample image according to the random number.
In an exemplary embodiment of the present disclosure, based on the foregoing scheme, the first processing module 1320 may be configured to determine to use a preset mark frame for the sample image when the random number is greater than or equal to a preset threshold; and when the random number is smaller than the preset threshold value, determining not to use a preset mark frame for the sample image.
In an exemplary embodiment of the present disclosure, based on the foregoing scheme, the training module 1340 may be further configured to train the neural network to be trained according to the sample image.
In an exemplary embodiment of the present disclosure, based on the foregoing scheme, the second processing module 1330 may be further configured to perform a geometric transformation on the sample image; adjusting the brightness of the sample image; and cropping the sample image.
For details that are not disclosed in the embodiments of the apparatus of the present disclosure, please refer to the embodiments of the neural network model training method of the present disclosure for the details that are not disclosed in the embodiments of the apparatus of the present disclosure.
It should be noted that although in the above detailed description several modules or units of the device for action execution are mentioned, such a division is not mandatory. Indeed, the features and functionality of two or more modules or units described above may be embodied in one module or unit, according to embodiments of the present disclosure. Conversely, the features and functions of one module or unit described above may be further divided into embodiments by a plurality of modules or units.
In addition, in an exemplary embodiment of the present disclosure, an electronic device capable of implementing the neural network model training method is also provided.
As will be appreciated by one skilled in the art, aspects of the present disclosure may be embodied as a system, method or program product. Accordingly, various aspects of the present disclosure may be embodied in the form of: an entirely hardware embodiment, an entirely software embodiment (including firmware, microcode, etc.) or an embodiment combining hardware and software aspects that may all generally be referred to herein as a "circuit," module "or" system.
An electronic device 1400 according to such an embodiment of the present disclosure is described below with reference to fig. 14. The electronic device 1400 shown in fig. 14 is only an example and should not bring any limitations to the functionality and scope of use of the embodiments of the present disclosure.
As shown in fig. 14, the electronic device 1400 is embodied in the form of a general purpose computing device. The components of the electronic device 1400 may include, but are not limited to: the at least one processing unit 1410, the at least one memory unit 1420, the bus 1430 that connects the various system components (including the memory unit 1420 and the processing unit 1410), and the display unit 1440.
Wherein the storage unit stores program code that is executable by the processing unit 1410, such that the processing unit 1410 performs steps according to various exemplary embodiments of the present disclosure described in the "exemplary methods" section above in this specification. For example, the processing unit 1410 may execute step S110 as shown in fig. 1: acquiring a sample image; s120: when the sample image is a sample image with a preset mark frame, determining whether to process the sample image according to a preset rule; s130: when the sample image is determined to be processed, processing the sample image according to the preset mark frame; and S140, training the neural network to be trained according to the processed sample image to obtain the neural network model.
As another example, the electronic device may implement the steps shown in fig. 2 to 6.
The storage unit 1420 may include readable media in the form of volatile memory units, such as a random access memory unit (RAM)1421 and/or a cache memory unit 1422, and may further include a read only memory unit (ROM) 1423.
Storage unit 1420 may also include a program/utility 1424 having a set (at least one) of program modules 1425, such program modules 1425 including, but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which, or some combination thereof, may comprise an implementation of a network environment.
Bus 1430 may be any type of bus structure including a memory cell bus or memory cell controller, a peripheral bus, an accelerated graphics port, a processing unit, or a local bus using any of a variety of bus architectures.
The electronic device 1400 may also communicate with one or more external devices 1470 (e.g., keyboard, pointing device, bluetooth device, etc.), with one or more devices that enable a user to interact with the electronic device 1400, and/or with any devices (e.g., router, modem, etc.) that enable the electronic device 1400 to communicate with one or more other computing devices. Such communication can occur via an input/output (I/O) interface 1450. Also, the electronic device 1400 may communicate with one or more networks (e.g., a Local Area Network (LAN), a Wide Area Network (WAN), and/or a public network, such as the internet) via the network adapter 1460. As shown, the network adapter 1460 communicates with the other modules of the electronic device 1400 via the bus 1430. It should be appreciated that although not shown in the figures, other hardware and/or software modules may be used in conjunction with the electronic device 1400, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, among others.
Through the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein may be implemented by software, or by software in combination with necessary hardware. Therefore, the technical solution according to the embodiments of the present disclosure may be embodied in the form of a software product, which may be stored in a non-volatile storage medium (which may be a CD-ROM, a usb disk, a removable hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which may be a personal computer, a server, a terminal device, or a network device, etc.) to execute the method according to the embodiments of the present disclosure.
In an exemplary embodiment of the present disclosure, there is also provided a computer-readable storage medium having stored thereon a program product capable of implementing the above-described method of the present specification. In some possible embodiments, aspects of the present disclosure may also be implemented in the form of a program product comprising program code for causing a terminal device to perform the steps according to various exemplary embodiments of the present disclosure described in the "exemplary methods" section above of this specification, when the program product is run on the terminal device.
Referring to fig. 15, a program product 1500 for implementing the above method according to an embodiment of the present disclosure is described, which may employ a portable compact disc read only memory (CD-ROM) and include program code, and may be run on a terminal device, such as a personal computer. However, the program product of the present disclosure is not limited thereto, and in this document, a readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
The program product may employ any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples (a non-exhaustive list) of the readable storage medium include: an electrical connection having one or more wires, a portable disk, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
A computer readable signal medium may include a propagated data signal with readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A readable signal medium may also be any readable medium that is not a readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Program code embodied on a readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Program code for carrying out operations for the present disclosure may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computing device, partly on the user's device, as a stand-alone software package, partly on the user's computing device and partly on a remote computing device, or entirely on the remote computing device or server. In the case of a remote computing device, the remote computing device may be connected to the user computing device through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computing device (e.g., through the internet using an internet service provider).
Furthermore, the above-described figures are merely schematic illustrations of processes included in methods according to exemplary embodiments of the present disclosure, and are not intended to be limiting. It will be readily understood that the processes shown in the above figures are not intended to indicate or limit the chronological order of the processes. In addition, it is also readily understood that these processes may be performed synchronously or asynchronously, e.g., in multiple modules.
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure disclosed herein. This disclosure is intended to cover any variations, uses, or adaptations of the disclosure following, in general, the principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.
It will be understood that the present disclosure is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is to be limited only by the terms of the appended claims.

Claims (11)

1. A neural network model training method is characterized by comprising the following steps:
acquiring a sample image;
when the sample image is a sample image with a preset mark frame, determining whether to process the sample image according to a preset rule;
when the sample image is determined to be processed, processing the sample image according to the preset mark frame;
and training the neural network to be trained according to the processed sample image to obtain the neural network model.
2. The method of claim 1, wherein the processing the sample image according to the preset mark frame comprises:
and cutting the sample image according to the preset mark frame to obtain the processed sample image.
3. The method of claim 1, wherein the processing the sample image according to the preset mark frame comprises:
zooming the preset mark frame according to a preset proportion to obtain a zoomed mark frame;
and cutting the sample image according to the scaled marking frame to obtain the processed sample image.
4. The method of claim 1, wherein the processing the sample image according to the preset marker box further comprises:
acquiring the vertex of a preset mark frame in the sample image;
disturbing the vertex of the preset mark frame to obtain a disturbed mark frame;
and cutting the sample image according to the disturbed mark frame to obtain the processed sample image.
5. The method according to claim 1, wherein the determining whether to process the sample image according to a preset rule comprises:
generating a random number;
and determining whether to process the sample image according to the random number.
6. The method of claim 5, wherein the determining whether to process the sample image according to the random number comprises:
when the random number is greater than or equal to a preset threshold value, determining to process the sample image;
and when the random number is smaller than the preset threshold value, determining not to process the sample image.
7. The method of claim 1, further comprising:
and training the neural network to be trained according to the sample image.
8. The method of claim 7, further comprising one or more of the following steps:
geometrically transforming the sample image;
adjusting the brightness of the sample image; and
and clipping the sample image.
9. An apparatus for neural network model training, the apparatus comprising:
the acquisition module is used for acquiring a sample image;
the first processing module is used for determining whether to process the sample image according to a preset rule when the sample image is the sample image with a preset mark frame;
the second processing module is used for processing the sample image according to the preset mark frame when the sample image is determined to be processed;
and the training module is used for training the neural network to be trained according to the processed sample image to obtain the neural network model.
10. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out a neural network model training method according to any one of claims 1 to 8.
11. An electronic device, comprising:
a processor; and
memory storing one or more programs that, when executed by the one or more processors, cause the one or more processors to implement the neural network model training method of any one of claims 1-8.
CN201910876941.4A 2019-09-17 2019-09-17 Neural network model training method and device, storage medium and electronic equipment Active CN110619600B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910876941.4A CN110619600B (en) 2019-09-17 2019-09-17 Neural network model training method and device, storage medium and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910876941.4A CN110619600B (en) 2019-09-17 2019-09-17 Neural network model training method and device, storage medium and electronic equipment

Publications (2)

Publication Number Publication Date
CN110619600A true CN110619600A (en) 2019-12-27
CN110619600B CN110619600B (en) 2023-12-08

Family

ID=68923229

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910876941.4A Active CN110619600B (en) 2019-09-17 2019-09-17 Neural network model training method and device, storage medium and electronic equipment

Country Status (1)

Country Link
CN (1) CN110619600B (en)

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106127780A (en) * 2016-06-28 2016-11-16 华南理工大学 A kind of curved surface defect automatic testing method and device thereof
CN108230358A (en) * 2017-10-27 2018-06-29 北京市商汤科技开发有限公司 Target following and neural network training method, device, storage medium, electronic equipment
CN109447895A (en) * 2018-09-03 2019-03-08 腾讯科技(武汉)有限公司 Picture Generation Method and device, storage medium and electronic device
CN109784255A (en) * 2019-01-07 2019-05-21 深圳市商汤科技有限公司 Neural network training method and device and recognition methods and device
US20190188530A1 (en) * 2017-12-20 2019-06-20 Baidu Online Network Technology (Beijing) Co., Ltd . Method and apparatus for processing image
CN109919010A (en) * 2019-01-24 2019-06-21 北京三快在线科技有限公司 Image processing method and device
CN110020647A (en) * 2018-01-09 2019-07-16 杭州海康威视数字技术股份有限公司 A kind of contraband object detection method, device and computer equipment
CN110110684A (en) * 2019-05-14 2019-08-09 深圳供电局有限公司 Foreign object identification method and device for power transmission line equipment and computer equipment

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106127780A (en) * 2016-06-28 2016-11-16 华南理工大学 A kind of curved surface defect automatic testing method and device thereof
CN108230358A (en) * 2017-10-27 2018-06-29 北京市商汤科技开发有限公司 Target following and neural network training method, device, storage medium, electronic equipment
US20190188530A1 (en) * 2017-12-20 2019-06-20 Baidu Online Network Technology (Beijing) Co., Ltd . Method and apparatus for processing image
CN110020647A (en) * 2018-01-09 2019-07-16 杭州海康威视数字技术股份有限公司 A kind of contraband object detection method, device and computer equipment
CN109447895A (en) * 2018-09-03 2019-03-08 腾讯科技(武汉)有限公司 Picture Generation Method and device, storage medium and electronic device
CN109784255A (en) * 2019-01-07 2019-05-21 深圳市商汤科技有限公司 Neural network training method and device and recognition methods and device
CN109919010A (en) * 2019-01-24 2019-06-21 北京三快在线科技有限公司 Image processing method and device
CN110110684A (en) * 2019-05-14 2019-08-09 深圳供电局有限公司 Foreign object identification method and device for power transmission line equipment and computer equipment

Also Published As

Publication number Publication date
CN110619600B (en) 2023-12-08

Similar Documents

Publication Publication Date Title
CN112380981A (en) Face key point detection method and device, storage medium and electronic equipment
CN107281753B (en) Scene sound effect reverberation control method and device, storage medium and electronic equipment
US20210200971A1 (en) Image processing method and apparatus
CN111199541A (en) Image quality evaluation method, image quality evaluation device, electronic device, and storage medium
US20230237763A1 (en) Image processing method and system
CN114549993A (en) Method, system and device for scoring line segment image in experiment and readable storage medium
CN115861462A (en) Training method and device for image generation model, electronic equipment and storage medium
CN112580666A (en) Image feature extraction method, training method, device, electronic equipment and medium
CN112861940A (en) Binocular disparity estimation method, model training method and related equipment
CN110008923B (en) Image processing method, training method, device, medium, and computing device
CN109597482B (en) Automatic page turning method and device for electronic book, medium and electronic equipment
CN113516697A (en) Image registration method and device, electronic equipment and computer-readable storage medium
CN113780469A (en) Training method, medium, device and computing equipment of image recognition model
CN110619600B (en) Neural network model training method and device, storage medium and electronic equipment
CN116152577B (en) Image classification method and device
CN114092608B (en) Expression processing method and device, computer readable storage medium and electronic equipment
CN110826616A (en) Information processing method and device, electronic equipment and storage medium
CN117234505A (en) Interactive page generation method, device, equipment and storage medium thereof
CN112530554B (en) Scanning positioning method and device, storage medium and electronic equipment
CN115565186A (en) Method and device for training character recognition model, electronic equipment and storage medium
CN113887414A (en) Target detection method, target detection device, electronic equipment and storage medium
CN114155567A (en) Target detection method and device, storage medium and electronic equipment
CN114936542B (en) Table reconstruction method and apparatus, computer readable storage medium and electronic device
CN118097706B (en) Method, system, equipment and medium for detecting graphic element of power grid station wiring diagram
CN111160197A (en) Face detection method and device, electronic 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