CN113269215A - Method, device, equipment and storage medium for constructing training set - Google Patents

Method, device, equipment and storage medium for constructing training set Download PDF

Info

Publication number
CN113269215A
CN113269215A CN202010096392.1A CN202010096392A CN113269215A CN 113269215 A CN113269215 A CN 113269215A CN 202010096392 A CN202010096392 A CN 202010096392A CN 113269215 A CN113269215 A CN 113269215A
Authority
CN
China
Prior art keywords
image
category
training set
images
classification 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
CN202010096392.1A
Other languages
Chinese (zh)
Other versions
CN113269215B (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.)
Beijing Baidu Netcom Science and Technology Co Ltd
Original Assignee
Beijing Baidu Netcom Science and 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 Beijing Baidu Netcom Science and Technology Co Ltd filed Critical Beijing Baidu Netcom Science and Technology Co Ltd
Priority to CN202010096392.1A priority Critical patent/CN113269215B/en
Publication of CN113269215A publication Critical patent/CN113269215A/en
Application granted granted Critical
Publication of CN113269215B publication Critical patent/CN113269215B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

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/24Classification techniques
    • G06F18/241Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches

Landscapes

  • Engineering & Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Artificial Intelligence (AREA)
  • Evolutionary Biology (AREA)
  • Evolutionary Computation (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Image Analysis (AREA)

Abstract

The application discloses a training set construction method, device, equipment and storage medium, and relates to the technical field of machine learning. The specific implementation scheme is as follows: acquiring a training set, wherein the training set comprises a plurality of marked first images; training a classification model by using a training set, and classifying unlabelled second images by using the trained classification model to obtain the class of the second images; labeling the second image according to the category and the image characteristics of the second image; adding the labeled second image to the training set. The embodiment can efficiently construct a high-precision training set, does not need manual participation, and saves labor cost.

Description

Method, device, equipment and storage medium for constructing training set
Technical Field
The application relates to computer technology, in particular to the technical field of machine learning.
Background
In the fields of machine learning and pattern recognition, etc., it is generally necessary to divide a sample into three independent parts: training set (train set), validation set (validation set) and test set (test set). Where the training set is used to train the model.
In an application scenario of training an image classification model by using a training set, the number of images and the accuracy of labeling affect the training precision of the classification model. In the prior art, the category to which each image belongs is generally manually marked, so that the labor cost is high, the consumed time is long, and the accuracy of manual marking is difficult to guarantee.
Disclosure of Invention
The embodiment of the application provides a method, a device, equipment and a storage medium for constructing a training set, so that a high-precision training set is constructed efficiently, and the labor cost is saved.
In a first aspect, an embodiment of the present application provides a method for constructing a training set, including:
acquiring a training set, wherein the training set comprises a plurality of marked first images;
training a classification model by using a training set, and classifying unlabelled second images by using the trained classification model to obtain the class of the second images;
labeling the second image according to the category and the image characteristics of the second image;
adding the labeled second image to the training set.
The method and the device are suitable for the condition that the number of the labeled first images is small, and the classification model with limited precision is trained through the plurality of labeled first images; classifying the second image which is not marked by the classification model with limited precision, and assisting by adopting image characteristics to obtain more accurate marks; and then the second image which is accurately marked is added into the training set, so that the high-precision training set is efficiently constructed, manual participation is not needed, and the labor cost is saved.
Optionally, labeling the second image according to the category and the image feature of the second image includes:
extracting image features of the second image;
judging whether the image characteristics of the second image meet the image characteristic conditions corresponding to the categories;
and if the image characteristics of the second image do not meet the image characteristic conditions corresponding to the categories, modifying the categories of the second image, and labeling the second image by adopting the modified categories.
In an alternative embodiment of the above application, the class obtained from the classification model has a correspondence with the image feature condition, that is, an image of a certain class should have an image feature corresponding to the class. And if the image characteristics of the second image do not meet the image characteristic conditions corresponding to the categories, correcting the categories of the second image to obtain the accurately labeled second image.
Optionally, the image features include: at least one of image edge energy, image high frequency energy, image gradient energy, and image entropy.
In an optional implementation manner in the above application, the image edge energy, the image high-frequency energy, the image gradient energy, and the image entropy can reflect the detail abundance degree of the image, and for the case that the images of different categories have details of different abundance degrees, at least one of the image edge energy, the image high-frequency energy, the image gradient energy, and the image entropy can be used to determine whether the classification category of the classification model is accurate, which is beneficial to accurately correcting the classification category.
Optionally, the determining whether the image feature of the second image meets the image feature condition corresponding to the category includes:
sorting a plurality of second images of the same category according to image characteristic values of the plurality of second images;
judging whether the sorting position of each second image is located in the sorting position range corresponding to the same category;
if the image feature of the second image does not meet the image feature condition corresponding to the category, the modifying the category of the second image includes:
and if the sorting position of the second image is not in the sorting position range, modifying the category of the second image into the category corresponding to the image characteristic value.
In an alternative embodiment of the foregoing application, the classification category of the classification model has a corresponding relationship with the range of the ranking position of the image feature value. If the sorting position of the second image is not in the range of the sorting position, indicating that the category of the second image is wrong; and correcting the category of the second image into a category corresponding to the image characteristic value according to the image characteristic value. According to the embodiment, the second image with the wrong category is accurately extracted through the sorting position, and the category of the second image can be accurately corrected through the image characteristics.
Optionally, the determining whether the image feature of the second image meets the image feature condition corresponding to the category includes:
judging whether the image characteristic value of the second image is in the range corresponding to the category;
if the image feature of the second image does not meet the image feature condition corresponding to the category, the modifying the category of the second image includes:
and if the image characteristic value of the second image is not in the range corresponding to the category, modifying the category of the second image into the category corresponding to the range in which the image characteristic value is located.
In an alternative embodiment of the above application, the classification category of the classification model has a corresponding relationship with a range of image feature values. If the image characteristic value of the second image is not in the range corresponding to the category, indicating that the category of the second image is wrong; and further correcting the category of the second image into a category corresponding to a range in which the image characteristic value is located. In the embodiment, the second image with the wrong category is accurately extracted according to the range of the image characteristic value, and the category of the second image can be accurately corrected according to the range in which the image characteristic value is positioned.
Optionally, after the adding the labeled second image to the training set, the method further includes:
and returning to the operation of training the classification model by using the training set until the precision of the classification model reaches a preset value or the number of images in the training set reaches a preset number.
According to the optional implementation mode in the application, along with the gradual expansion of the training set, the accuracy of the classification model is gradually improved, a more accurate classification result can be obtained, and more accurate labeling is facilitated.
Optionally, the image is a satellite image of a geographic area; the categories include: a map element removed category and a map element unremoved category.
An optional implementation manner in the application is suitable for the situation of constructing a training set of satellite images in a geographic area, and does not need to label the satellite images manually in a large quantity; the classification model trained by the training set classifies the satellite images into a map element removal class and a map element unremoved class, and the two classes have a corresponding relation with image characteristics, particularly the detail richness of the images. Therefore, accurate labeling can be obtained through the two categories and the image characteristics.
In a second aspect, an embodiment of the present application further provides an apparatus for constructing a training set, including:
the acquisition module is used for acquiring a training set, and the training set comprises a plurality of marked first images;
the classification module is used for training a classification model by adopting a training set and classifying the second image which is not marked by adopting the trained classification model to obtain the class of the second image;
the labeling module is used for labeling the second image according to the category and the image characteristics of the second image;
an adding module, configured to add the labeled second image to the training set.
In a third aspect, an embodiment of the present application further provides an electronic device, including:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute a training set construction method provided by the embodiment of the first aspect.
In a fourth aspect, embodiments of the present application further provide a non-transitory computer-readable storage medium storing computer instructions for causing a computer to execute a training set constructing method as provided in the first aspect.
Other effects of the above-described alternative will be described below with reference to specific embodiments.
Drawings
The drawings are included to provide a better understanding of the present solution and are not intended to limit the present application. Wherein:
FIG. 1 is a flowchart of a training set construction method in a first embodiment of the present application;
FIG. 2 is a flowchart of a training set construction method in the second embodiment of the present application;
FIG. 3 is a block diagram of an apparatus for constructing a training set according to a third embodiment of the present application;
fig. 4 is a block diagram of an electronic device for implementing a training set construction method according to an embodiment of the present application.
Detailed Description
The following description of the exemplary embodiments of the present application, taken in conjunction with the accompanying drawings, includes various details of the embodiments of the application for the understanding of the same, which are to be considered exemplary only. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the present application. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
Example one
Fig. 1 is a flowchart of a training set constructing method in an embodiment of the present application, where the embodiment of the present application is applied to a case where a training set includes only a small number of labeled images, and the method is performed by a training set constructing apparatus, which is implemented by software and/or hardware and is specifically configured in an electronic device with certain data computation capability.
A method for constructing a training set as shown in fig. 1 includes:
s101, a training set is obtained, wherein the training set comprises a plurality of marked first images.
In this embodiment, the training set is used to train a classification model, and includes a plurality of images with labeled categories. The number of categories is at least two, such as cat category, dog category, etc. For convenience of description and distinction, the already labeled image in the training set is referred to as the first image.
Optionally, the first image is a manually labeled image, and the number of the images is small, for example, 100 images. Obviously, a small number of first images is not enough to train a high-precision classification model, and new labeled images need to be added to the training set.
In the embodiment, the classification model and the image characteristics are adopted, the unmarked images are automatically marked in a combined mode, and the high-precision training set is efficiently constructed.
And S102, training a classification model by adopting the training set, and classifying the unlabeled second image by adopting the trained classification model to obtain the class of the second image.
Specifically, the labeled first image is input into a classification model to be trained to obtain a classification result output by the classification model, and parameters of the classification model are iterated continuously to enable the classification result to approach the label of the input image, so that the classification model with certain classification precision is obtained.
Next, a plurality of unlabelled images are acquired. For convenience of description and distinction, the unlabeled image is referred to as a second image. And inputting the second image which is not marked to the classification model obtained by the training to obtain the category of the second image.
And S103, labeling the second image according to the category and the image characteristics of the second image.
Due to the limited classification accuracy of the classification model, the class of the second image may be wrong or correct, and the accurate class needs to be further determined according to the image characteristics of the second image.
In the present embodiment, the image features are features associated with categories, and images of different categories have different image features. Optionally, the image features include image pixel features, image depth features, and the like. For example, most of the pixels in the image of the white cloud category are white in color, and the depth features of the image of the cat category are local detail features of the cat.
Optionally, the image feature of the second image is extracted, and if the category of the second image obtained by the classification model is consistent with the category associated with the image feature, the category is adopted to label the second image. And if the category of the second image obtained by the classification model is not consistent with the category associated with the image feature, the category needs to be corrected so as to enable the corrected category to be consistent with the category associated with the image feature, and the corrected category is adopted to label the second image.
And S104, adding the labeled second image into the training set.
Based on this, the training set comprises the original labeled first image and the subsequent labeled second image, and the expansion of the training set is realized.
The method and the device are suitable for the condition that the number of the labeled first images is small, and the classification model with limited precision is trained through the plurality of labeled first images; classifying the second image which is not marked by the classification model with limited precision, and assisting by adopting image characteristics to obtain more accurate marks; and then the second image which is accurately marked is added into the training set, so that the high-precision training set is efficiently constructed, manual participation is not needed, and the labor cost is saved.
Example two
Fig. 2 is a flowchart of a training set construction method in the second embodiment of the present application, and the second embodiment of the present application performs optimization and improvement on the basis of the technical solutions of the foregoing embodiments.
Further, the operation of labeling the second image according to the category and the image characteristics of the second image is refined into extraction of the image characteristics of the second image; judging whether the image characteristics of the second image meet the image characteristic conditions corresponding to the categories; and if the image characteristics of the second image do not meet the image characteristic conditions corresponding to the categories, modifying the categories of the second image, and labeling the second image by adopting the modified categories, thereby obtaining the accurately labeled second image.
Further, the operation of training the classification model by the training set is returned after the operation of adding the labeled second image into the training set is performed until the precision of the classification model reaches a preset value or the number of the images in the training set reaches a preset number, so that more accurate labeling can be obtained.
A method for constructing a training set as shown in fig. 2 includes:
s201, obtaining a training set, wherein the training set comprises a plurality of labeled first images.
S202, training a classification model by using the training set, and classifying the unlabeled second image by using the trained classification model to obtain the class of the second image.
S201 and S202 are described in detail in the above embodiments, and are not described again here.
And S203, extracting the image characteristics of the second image.
Optionally, the image features comprise: at least one of image edge energy, image high frequency energy, image gradient energy, and image entropy.
For the image edge energy, the edge of the image is extracted by adopting a Laplacian operator, and then the sum of the edge pixel values of the image or the sum of squares is calculated to obtain the image edge energy. The image edge energy can reflect the richness and definition of the edge, and highlight the area with severe gray change. If the image gray scale changes drastically, i.e., the detail texture is much and complicated, the obtained edge energy value is large.
For high frequency energy of the image, a frequency domain function can be adopted to take high frequency band energy in Fourier transform of the image. The edge shows a large rise and fall of gray scale in the spatial domain and reflects high-frequency energy in the frequency domain, that is, the high-frequency energy of the image is concentrated at the edge of the image. If the detail texture of the image is much and complex, the resulting high frequency energy value is large.
And for the image gradient energy, obtaining the gradient energy of the image by adopting a gradient energy function. The gradient energy function takes the difference value of adjacent pixels in the image as an evaluation function, and if the detail texture of the image is more and complicated, the obtained gradient value is larger.
For the image entropy, the entropy function is adopted to calculate the image entropy. When the edge details are richer, a larger information amount is provided, and the obtained image entropy is larger.
The image edge energy, the image high-frequency energy, the image gradient energy and the image entropy can reflect the detail abundance degree of the image, and for the situation that the images of different classes have the details with different abundance degrees, at least one of the image edge energy, the image high-frequency energy, the image gradient energy and the image entropy can be adopted to judge whether the classification class of the classification model is accurate, thereby being beneficial to accurately correcting the classification class.
And S204, judging whether the image characteristics of the second image meet the image characteristic conditions corresponding to the categories. If yes, S205 is performed, and if no, S206 is performed.
And S205, labeling the second image by using the category obtained by the classification model. Execution continues with S207.
S206, correcting the type of the second image, and labeling the second image by adopting the corrected type. Execution continues with S207.
In this embodiment, the image features and the categories are associated with each other by image feature conditions. Specifically, a corresponding image feature condition is configured for each category. And when the image characteristics of the second image meet the image characteristic conditions corresponding to a certain category, judging that the second image belongs to the category. By setting the image feature conditions, the corresponding relation between each image feature and the category does not need to be set, and the category judgment of the second images is convenient to carry out in batch.
In an alternative embodiment, the plurality of second images are sorted according to the image feature values of the plurality of second images of the same category, for example, sorted from large to small or sorted from small to large. Then, whether the sorting position of each second image is located in the sorting position range corresponding to the same category is judged. The category has a correspondence with the sort position range. For example, the image detail texture of the a category is rich and the image edge energy value is high. When the images are sorted from large to small according to the image edge energy value, the sort position range corresponding to the category A comprises the front preset number of positions of the sequence; for another example, the B-class image has poor detail texture and low image edge energy value. When the images are sorted from large to small according to the image edge energy value, the sort position range corresponding to the B category comprises a post-preset number of positions of the sequence.
And judging that if the sequencing position of the second image is in the sequencing position range, indicating that the second image belongs to the category, labeling the second image by using the category obtained by the classification model. And if the sorting position of the second image is not in the sorting position range, the second image does not belong to the category, and the category of the second image is further corrected to be the category corresponding to the image characteristic value. Following the above example, if the sorted positions of the second image classified as the a category are not the top preset number of positions, the category B corresponding to the image edge energy value of the second image is determined, and the second image is labeled as the category B. According to the embodiment, the second image with the wrong category is accurately extracted through the sorting position, and the category of the second image can be accurately corrected through the image characteristics.
In another alternative embodiment, it is determined whether the image feature value of the second image is within a range corresponding to the category. The category and the image characteristic value range have a corresponding relation, for example, the detail texture of the image of the category A is rich, and the image edge energy value range is more than 500; for another example, the B-class image has poor detail texture, and the range of the image edge energy value is 500 or less.
And judging that if the image characteristic value of the second image is in the image characteristic range corresponding to the category, which indicates that the second image belongs to the category, labeling the second image by using the category obtained by the classification model. If the image characteristic value of the second image is not in the range corresponding to the category, the second image is not in the category, and the category of the second image is further corrected to the category corresponding to the range in which the image characteristic value is located. Following the above example, if the image edge energy value of the second image classified as the a category is 400, i.e., 500 or less, the category B corresponding to the image edge energy value of the second image is determined, and the second image is labeled as the category B. In the embodiment, the second image with the wrong category is accurately extracted according to the range of the image characteristic value, and the category of the second image can be accurately corrected according to the range in which the image characteristic value is positioned.
And S207, adding the labeled second image into a training set.
S208, judging whether the precision of the classification model reaches a preset value, if not, continuing to execute S209; if so, S210 is performed.
S209, judging whether the number of the images in the training set reaches a preset number, and if so, jumping to S210; if not, it jumps to S202.
And constructing a test set comprising a plurality of images in advance, and carrying out precision test on the classification model on the test set. And if the precision of the classification model reaches a preset value, the current training set can be trained to obtain the high-precision classification model, and then the training set is output. If the precision of the classification model does not reach the preset value, whether the number of the images in the training set reaches the preset number needs to be further judged.
If the number of the images in the training set reaches a preset number, outputting the training set; and if the number of the images in the training set does not reach the preset number, returning to execute the training operation of the classification model so as to continue to label the new second image and expand the training set. The preset value can be set autonomously according to the precision requirement of the classification model. The preset number may be set autonomously according to the sample number requirement.
It should be noted that, when the training operation of the classification model is performed in a return mode, since the number of images in the training set is increased, the accuracy of the trained classification model is improved, and the number of images which are wrongly classified is reduced. Then, when determining whether the image feature of the second image satisfies the image feature condition corresponding to the category, the image feature condition needs to be adjusted according to the accuracy of the classification model or the cycle number. For example, when the precision is 90% or within 5 cycles, the sequencing position range is 90% before or after the sequence; when the precision is 95% or 5-10 times of circulation, the sequencing position range is 95% before or after the sequence.
It is to be noted that, in the present embodiment, S209 is executed first and then S210 is executed, but the present invention is not limited thereto, and S210 may be executed first and then S209 may be executed.
And S210, outputting a training set and finishing the operation.
In this embodiment, the categories obtained by the classification model have a corresponding relationship with the image feature conditions, that is, an image of a certain category should have an image feature corresponding to the category. And if the image characteristics of the second image do not meet the image characteristic conditions corresponding to the categories, correcting the categories of the second image to obtain the accurately labeled second image.
In the embodiment, the operation of training the classification model by using the training set is returned until the precision of the classification model reaches the preset value or the number of the images in the training set reaches the preset number, and along with the gradual expansion of the training set, the accuracy of the classification model is gradually improved, so that a more accurate classification result can be obtained, and more accurate labeling can be obtained.
The method for constructing the training set provided by the embodiment is described in detail in a specific application scenario.
In the application scenario, the image is a satellite image of a geographic area. The geographic area includes an migrated area and a non-migrated area. Since the points of Interest (POIs) of buildings, roads, business supermarkets, hospitals, etc. covered by the removal area are all removed, the satellite image including the removal area should be labeled as a map element removal category. The non-migrated region includes a large number of POIs, and satellite images including the non-migrated region should be labeled as a map element unremoved category.
Since the removal area is mainly an open land or a bare land covered with green cloth, the satellite image including the removal area has low richness of details and low image edge energy value. The non-removed area comprises a large number of POI, and the satellite image comprising the non-removed area has high detail richness, so the image edge energy value is high. Therefore, image edge energy is employed as an image feature.
The first step is as follows: a plurality of satellite images obtained by shooting a geographical area are acquired. And performing manual category labeling on part of the satellite images (namely the first images), wherein the manual category labeling comprises a map element removal category and a map element unremoved category, and obtaining a training set A. And then, calculating the unmarked satellite image by using a Laplacian operator to obtain an image edge energy value.
The second step is that: and training a classification model T by using the training set A, and classifying a part of unlabelled satellite images (namely, second images) by using the trained classification model T to obtain an image set L1 with the map element removed category and an image set L2 with the map element not removed category.
The third step: the images in the image set L1 are sorted in order of the image edge energy value from large to small. The top ranked portion, e.g., 3%, at a predetermined scale is labeled "map element not removed". The image set L1 is added to the training set a. The images in the image set L2 are sorted in order of smaller to larger image edge energy values. Taking the top ranked portion of the preset scale, e.g., 3%, the correction is labeled "map element removed". The image set L2 is added to the training set a.
It should be noted that, when the third step is executed in a loop, the preset ratio needs to be adjusted according to the precision of the classification model or the loop frequency.
And repeating the second step and the third step until the precision of the classification model reaches a preset value or the number of the images in the training set A reaches a preset number.
EXAMPLE III
Fig. 3 is a structural diagram of an apparatus for constructing a training set according to a third embodiment of the present invention, which is suitable for efficiently and accurately expanding a training set when the training set includes only a small number of labeled images, and which is implemented by software and/or hardware and is specifically configured in an electronic device having a certain data computation capability.
An apparatus 300 for constructing a training set, as shown in fig. 3, includes: an acquisition module 301, a classification module 302, a labeling module 303 and an adding module 304; wherein the content of the first and second substances,
an obtaining module 301, configured to obtain a training set, where the training set includes a plurality of labeled first images;
the classification module 302 is configured to train a classification model by using a training set, and classify the unlabeled second image by using the trained classification model to obtain a category of the second image;
the labeling module 303 is configured to label the second image according to the category and the image feature of the second image;
an adding module 304, configured to add the labeled second image to the training set.
The method and the device are suitable for the condition that the number of the labeled first images is small, and the classification model with limited precision is trained through the plurality of labeled first images; classifying the second image which is not marked by the classification model with limited precision, and assisting by adopting image characteristics to obtain more accurate marks; and then the second image which is accurately marked is added into the training set, so that the high-precision training set is efficiently constructed, manual participation is not needed, and the labor cost is saved.
Further, the labeling module 303 is specifically configured to: extracting image features of the second image; judging whether the image characteristics of the second image meet the image characteristic conditions corresponding to the categories; and if the image characteristics of the second image do not meet the image characteristic conditions corresponding to the categories, modifying the categories of the second image, and labeling the second image by adopting the modified categories.
Further, the image features include: at least one of image edge energy, image high frequency energy, image gradient energy, and image entropy.
Further, when determining whether the image feature of the second image satisfies the image feature condition corresponding to the category, the labeling module 303 is specifically configured to: sequencing the plurality of second images according to the image characteristic values of the plurality of second images in the same category; and judging whether the sorting position of each second image is located in the sorting position range corresponding to the same category. The labeling module 303, when modifying the category of the second image if the image feature of the second image does not satisfy the image feature condition corresponding to the category, is specifically configured to: and if the sorting position of the second image is not in the range of the sorting position, modifying the category of the second image into the category corresponding to the image characteristic value.
Further, when determining whether the image feature of the second image satisfies the image feature condition corresponding to the category, the labeling module 303 is specifically configured to: and judging whether the image characteristic value of the second image is in the range corresponding to the category. The labeling module 303, when modifying the category of the second image if the image feature of the second image does not satisfy the image feature condition corresponding to the category, is specifically configured to: and if the image characteristic value of the second image is not in the range corresponding to the category, modifying the category of the second image into the category corresponding to the range in which the image characteristic value is positioned.
Further, the apparatus further comprises: and the returning module is used for returning to the operation of training the classification model by adopting the training set after the labeled second image is added into the training set until the precision of the classification model reaches a preset value or the number of the images in the training set reaches a preset number.
Further, the image is a satellite image of a geographic area; the categories include: a map element removed category and a map element unremoved category.
The device for constructing the training set can execute the method for constructing the training set provided by any embodiment of the application, and has the corresponding functional modules and beneficial effects of the method for constructing the training set.
Example four
According to an embodiment of the present application, an electronic device and a readable storage medium are also provided.
Fig. 4 is a block diagram of an electronic device implementing the training set construction method according to the embodiment of the present application. Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be examples only, and are not meant to limit implementations of the present application that are described and/or claimed herein.
As shown in fig. 4, the electronic apparatus includes: one or more processors 401, memory 402, and interfaces for connecting the various components, including high-speed interfaces and low-speed interfaces. The various components are interconnected using different buses and may be mounted on a common motherboard or in other manners as desired. The processor may process instructions for execution within the electronic device, including instructions stored in or on the memory to display graphical information of a GUI on an external input/output apparatus (such as a display device coupled to the interface). In other embodiments, multiple processors and/or multiple buses may be used, along with multiple memories and multiple memories, as desired. Also, multiple electronic devices may be connected, with each device providing portions of the necessary operations (e.g., as a server array, a group of blade servers, or a multi-processor system). In fig. 4, one processor 401 is taken as an example.
Memory 402 is a non-transitory computer readable storage medium as provided herein. The memory stores instructions executable by the at least one processor to cause the at least one processor to perform the training set construction method provided by the present application. The non-transitory computer-readable storage medium of the present application stores computer instructions for causing a computer to execute the method of constructing a training set provided by the present application.
The memory 402, which is a non-transitory computer readable storage medium, may be used to store non-transitory software programs, non-transitory computer executable programs, and modules, such as program instructions/modules corresponding to the method of construction of a training set in the embodiments of the present application (e.g., shown in fig. 3 as including the obtaining module 301, the classifying module 302, the labeling module 303, and the adding module 304). The processor 401 executes various functional applications of the server and data processing, i.e., a method for implementing the construction of the training set in the above-described method embodiments, by executing the non-transitory software programs, instructions, and modules stored in the memory 402.
The memory 402 may include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function; the storage data area may store data created by use of an electronic device that implements the construction method of the training set, and the like. Further, the memory 402 may include high speed random access memory, and may also include non-transitory memory, such as at least one magnetic disk storage device, flash memory device, or other non-transitory solid state storage device. In some embodiments, the memory 402 may optionally include a memory remotely located from the processor 401, and these remote memories may be connected over a network to an electronic device that performs the training set construction method. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The electronic device that performs the method of constructing the training set may further include: an input device 403 and an output device 404. The processor 401, the memory 402, the input device 403 and the output device 404 may be connected by a bus or other means, and fig. 4 illustrates an example of a connection by a bus.
The input device 403 may receive input numeric or character information and generate key signal inputs related to user settings and function control of an electronic apparatus performing the construction method of the training set, such as a touch screen, a keypad, a mouse, a track pad, a touch pad, a pointing stick, one or more mouse buttons, a track ball, a joystick, or other input devices. The output devices 404 may include a display device, auxiliary lighting devices (e.g., LEDs), and haptic feedback devices (e.g., vibrating motors), among others. The display device may include, but is not limited to, a Liquid Crystal Display (LCD), a Light Emitting Diode (LED) display, and a plasma display. In some implementations, the display device can be a touch screen.
Various implementations of the systems and techniques described here can be realized in digital electronic circuitry, integrated circuitry, application specific ASICs (application specific integrated circuits), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs that are executable and/or interpretable on a programmable system including at least one programmable processor, which may be special or general purpose, receiving data and instructions from, and transmitting data and instructions to, a storage system, at least one input device, and at least one output device.
These computer programs (also known as programs, software applications, or code) include machine instructions for a programmable processor, and may be implemented using high-level procedural and/or object-oriented programming languages, and/or assembly/machine languages. As used herein, the terms "machine-readable medium" and "computer-readable medium" refer to any computer program product, apparatus, and/or device (e.g., magnetic discs, optical disks, memory, Programmable Logic Devices (PLDs)) used to provide machine instructions and/or data to a programmable processor, including a machine-readable medium that receives machine instructions as a machine-readable signal. The term "machine-readable signal" refers to any signal used to provide machine instructions and/or data to a programmable processor.
To provide for interaction with a user, the systems and techniques described here can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and a pointing device (e.g., a mouse or a trackball) by which a user can provide input to the computer. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form, including acoustic, speech, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a back-end component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such back-end, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), Wide Area Networks (WANs), the internet, and blockchain networks.
The computer system may include clients and servers. A client and server are generally remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other.
The method and the device are suitable for the condition that the number of the labeled first images is small, and the classification model with limited precision is trained through the plurality of labeled first images; classifying the second image which is not marked by the classification model with limited precision, and assisting by adopting image characteristics to obtain more accurate marks; and then the second image which is accurately marked is added into the training set, so that the high-precision training set is efficiently constructed, manual participation is not needed, and the labor cost is saved.
It should be understood that various forms of the flows shown above may be used, with steps reordered, added, or deleted. For example, the steps described in the present application may be executed in parallel, sequentially, or in different orders, and the present invention is not limited thereto as long as the desired results of the technical solutions disclosed in the present application can be achieved.
The above-described embodiments should not be construed as limiting the scope of the present application. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may be made in accordance with design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present application shall be included in the protection scope of the present application.

Claims (10)

1. A method for constructing a training set, comprising:
acquiring a training set, wherein the training set comprises a plurality of marked first images;
training a classification model by using the training set, and classifying the unlabelled second image by using the trained classification model to obtain the class of the second image;
labeling the second image according to the category and the image characteristics of the second image;
adding the labeled second image to the training set.
2. The method of claim 1, wherein the labeling the second image according to the class and the image feature of the second image comprises:
extracting image features of the second image;
judging whether the image characteristics of the second image meet the image characteristic conditions corresponding to the categories;
and if the image characteristics of the second image do not meet the image characteristic conditions corresponding to the categories, modifying the categories of the second image, and labeling the second image by adopting the modified categories.
3. The method of claim 1 or 2, wherein the image features comprise: at least one of image edge energy, image high frequency energy, image gradient energy, and image entropy.
4. The method according to claim 2, wherein the determining whether the image feature of the second image satisfies the image feature condition corresponding to the category includes:
sorting the second images according to the image characteristic values of the second images in the same category;
judging whether the sorting position of each second image is located in the sorting position range corresponding to the same category;
if the image feature of the second image does not meet the image feature condition corresponding to the category, the modifying the category of the second image includes:
and if the sorting position of the second image is not in the sorting position range, modifying the category of the second image into the category corresponding to the image characteristic value.
5. The method according to claim 2, wherein the determining whether the image feature of the second image satisfies the image feature condition corresponding to the category includes:
judging whether the image characteristic value of the second image is in the range corresponding to the category;
if the image feature of the second image does not meet the image feature condition corresponding to the category, the modifying the category of the second image includes:
and if the image characteristic value of the second image is not in the range corresponding to the category, modifying the category of the second image into the category corresponding to the range in which the image characteristic value is located.
6. The method according to any one of claims 1-5, further comprising, after said adding the labeled second image to the training set:
and returning to the operation of training the classification model by using the training set until the precision of the classification model reaches a preset value or the number of images in the training set reaches a preset number.
7. The method according to any one of claims 1 to 5,
the image is a satellite image of a geographic area;
the categories include: a map element removed category and a map element unremoved category.
8. An apparatus for constructing a training set, comprising:
the acquisition module is used for acquiring a training set, wherein the training set comprises a plurality of marked first images;
the classification module is used for training a classification model by adopting the training set and classifying the second image which is not marked by adopting the trained classification model to obtain the class of the second image;
the labeling module is used for labeling the second image according to the category and the image characteristics of the second image;
and the adding module is used for adding the labeled second image into the training set.
9. An electronic device, comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform a training set construction method as claimed in any one of claims 1 to 7.
10. A non-transitory computer readable storage medium storing computer instructions for causing a computer to execute a training set construction method according to any one of claims 1 to 7.
CN202010096392.1A 2020-02-17 2020-02-17 Training set construction method, device, equipment and storage medium Active CN113269215B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010096392.1A CN113269215B (en) 2020-02-17 2020-02-17 Training set construction method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010096392.1A CN113269215B (en) 2020-02-17 2020-02-17 Training set construction method, device, equipment and storage medium

Publications (2)

Publication Number Publication Date
CN113269215A true CN113269215A (en) 2021-08-17
CN113269215B CN113269215B (en) 2023-08-01

Family

ID=77227503

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010096392.1A Active CN113269215B (en) 2020-02-17 2020-02-17 Training set construction method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN113269215B (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108470185A (en) * 2018-02-12 2018-08-31 北京佳格天地科技有限公司 The atural object annotation equipment and method of satellite image
CN108764372A (en) * 2018-06-08 2018-11-06 Oppo广东移动通信有限公司 Construction method and device, mobile terminal, the readable storage medium storing program for executing of data set
US20180373979A1 (en) * 2017-06-22 2018-12-27 Adobe Systems Incorporated Image captioning utilizing semantic text modeling and adversarial learning
CN109543713A (en) * 2018-10-16 2019-03-29 北京奇艺世纪科技有限公司 The modification method and device of training set
CN109840531A (en) * 2017-11-24 2019-06-04 华为技术有限公司 The method and apparatus of training multi-tag disaggregated model

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20180373979A1 (en) * 2017-06-22 2018-12-27 Adobe Systems Incorporated Image captioning utilizing semantic text modeling and adversarial learning
CN109840531A (en) * 2017-11-24 2019-06-04 华为技术有限公司 The method and apparatus of training multi-tag disaggregated model
CN108470185A (en) * 2018-02-12 2018-08-31 北京佳格天地科技有限公司 The atural object annotation equipment and method of satellite image
CN108764372A (en) * 2018-06-08 2018-11-06 Oppo广东移动通信有限公司 Construction method and device, mobile terminal, the readable storage medium storing program for executing of data set
CN109543713A (en) * 2018-10-16 2019-03-29 北京奇艺世纪科技有限公司 The modification method and device of training set

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
ZONGWEI ZHOU等: "Fine-tuning Convolutional Neural Networks for Biomedical Image Analysis: Actively and Incrementally", CVPR2017, pages 7340 - 7349 *
黎健成;袁春;宋友;: "基于卷积神经网络的多标签图像自动标注", 计算机科学, no. 07, pages 41 - 45 *

Also Published As

Publication number Publication date
CN113269215B (en) 2023-08-01

Similar Documents

Publication Publication Date Title
CN111582453B (en) Method and device for generating neural network model
US11694461B2 (en) Optical character recognition method and apparatus, electronic device and storage medium
CN111782977B (en) Point-of-interest processing method, device, equipment and computer readable storage medium
CN111598164B (en) Method, device, electronic equipment and storage medium for identifying attribute of target object
KR20220113829A (en) Vehicle tracking methods, devices and electronic devices
CN111488925B (en) Data labeling method and device, electronic equipment and storage medium
CN112668586B (en) Model training method, picture processing device, storage medium, and program product
CN112541332B (en) Form information extraction method and device, electronic equipment and storage medium
US20220027705A1 (en) Building positioning method, electronic device, storage medium and terminal device
CN112784732B (en) Method, device, equipment and medium for identifying and model training of feature type change
CN111090991A (en) Scene error correction method and device, electronic equipment and storage medium
CN111275011A (en) Mobile traffic light detection method and device, electronic equipment and storage medium
CN111783760A (en) Character recognition method and device, electronic equipment and computer readable storage medium
CN112149741A (en) Training method and device of image recognition model, electronic equipment and storage medium
CN111967490A (en) Model training method for map detection and map detection method
CN110514211B (en) Positioning method, apparatus, device and medium
CN111709428A (en) Method and device for identifying key point positions in image, electronic equipment and medium
CN115359308A (en) Model training method, apparatus, device, storage medium, and program for identifying difficult cases
CN112100530B (en) Webpage classification method and device, electronic equipment and storage medium
CN112784102A (en) Video retrieval method and device and electronic equipment
CN111767990A (en) Neural network processing method and device
CN112348107A (en) Image data cleaning method and apparatus, electronic device, and medium
CN111104418A (en) Text description processing method and device and electronic equipment
CN113269215B (en) Training set construction method, device, equipment and storage medium
CN113269213B (en) Training set acquisition method and device and electronic equipment

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