WO2022160736A1 - Image annotation method and apparatus, electronic device, storage medium and program - Google Patents

Image annotation method and apparatus, electronic device, storage medium and program Download PDF

Info

Publication number
WO2022160736A1
WO2022160736A1 PCT/CN2021/118580 CN2021118580W WO2022160736A1 WO 2022160736 A1 WO2022160736 A1 WO 2022160736A1 CN 2021118580 W CN2021118580 W CN 2021118580W WO 2022160736 A1 WO2022160736 A1 WO 2022160736A1
Authority
WO
WIPO (PCT)
Prior art keywords
image
target
image block
information corresponding
pixel
Prior art date
Application number
PCT/CN2021/118580
Other languages
French (fr)
Chinese (zh)
Inventor
李嘉辉
Original Assignee
上海商汤智能科技有限公司
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 上海商汤智能科技有限公司 filed Critical 上海商汤智能科技有限公司
Publication of WO2022160736A1 publication Critical patent/WO2022160736A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/50Information retrieval; Database structures therefor; File system structures therefor of still image data
    • G06F16/58Retrieval characterised by using metadata, e.g. metadata not derived from the content or metadata generated manually
    • G06F16/5866Retrieval characterised by using metadata, e.g. metadata not derived from the content or metadata generated manually using information manually generated, e.g. tags, keywords, comments, manually generated location and time information
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods
    • GPHYSICS
    • G16INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR SPECIFIC APPLICATION FIELDS
    • G16HHEALTHCARE INFORMATICS, i.e. INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR THE HANDLING OR PROCESSING OF MEDICAL OR HEALTHCARE DATA
    • G16H30/00ICT specially adapted for the handling or processing of medical images
    • G16H30/40ICT specially adapted for the handling or processing of medical images for processing medical images, e.g. editing

Definitions

  • the present disclosure is based on the Chinese patent application with the application number of 202110116990.5, the application date of January 28, 2021, and the application title of "An Image Annotation Method, Device, Electronic Device and Storage Medium", and requires the priority of the above-mentioned Chinese patent application
  • the entire contents of the above-mentioned Chinese patent application are hereby incorporated into the present disclosure by reference.
  • the present disclosure relates to the technical field of image recognition, in particular, but not limited to, an image labeling method, apparatus, electronic device, storage medium and program.
  • a neural network for image recognition can be trained, such as a neural network for image target detection.
  • the neural network can mark the target object in the image through the detection frame; for example, a neural network can be trained for semantic segmentation of the image, and the neural network can determine the contour of the target object in the image.
  • the annotation information includes the detection frame annotation data of the target object, the outline annotation data of the target object, etc.
  • the annotation of these annotation information usually requires a lot of manual annotation operations.
  • Embodiments of the present disclosure provide an image labeling method, apparatus, electronic device, storage medium, and program.
  • An embodiment of the present disclosure provides an image labeling method, the method comprising:
  • the target image is divided into blocks to obtain a plurality of image blocks
  • the target image is annotated based on the labeling manner corresponding to the target image and the category information corresponding to each image block.
  • performing encoding processing on each image block in the plurality of image blocks to obtain encoding information corresponding to each image block includes:
  • the coding information corresponding to each image block is determined based on the image feature of each image block.
  • the labeling of the target image based on the labeling manner corresponding to the target image and the category information corresponding to each image block includes:
  • the labeling method is to label a rectangular frame, obtain image blocks with the same corresponding category information
  • the target image is marked according to the smallest peripheral rectangular frame of the image blocks with the same corresponding category information.
  • the labeling of the target image based on the labeling manner corresponding to the target image and the category information corresponding to each image block includes:
  • the class information corresponding to each pixel point in the target image is determined based on the class information corresponding to each image block and the pixel points included in each image block;
  • the target pixel is the pixel to be adjusted for category information
  • the category information corresponding to the target pixel is adjusted based on the category information of the pixel with the same attribute feature as the target pixel to obtain each pixel in the target image.
  • determining the target pixel based on the category information and attribute features corresponding to each pixel includes:
  • the difference value of the attribute feature of the first pixel point and the second pixel point is determined; wherein, the second pixel point is adjacent to the first pixel point;
  • the difference value is greater than the preset threshold
  • at least one third pixel is selected; wherein, the third pixel is a pixel with the same attribute feature as the first pixel;
  • the first pixel point is used as the target pixel point.
  • the labeling of the target image based on the labeling manner corresponding to the target image and the category information corresponding to each image block includes:
  • the labeling method is to perform classification labeling, based on the category information corresponding to each image block, determine the number of image blocks corresponding to each category information;
  • the category information of the target image is determined based on the number of image blocks corresponding to each category of information.
  • the image labeling method further includes:
  • the neural network is obtained by:
  • a first sample image block pair and a second native image block pair are determined; wherein the distance between the two sample image blocks in the first sample image block pair is less than or is equal to a set threshold, and the distance between two sample image blocks in the second sample image block pair is greater than the set threshold;
  • the network parameters of the neural network to be trained are adjusted to obtain a trained neural network for coding.
  • the embodiment of the present disclosure also provides an image labeling device, including:
  • the image acquisition module is configured to: acquire the target image to be marked;
  • the image segmentation module is configured to: block the target image to obtain a plurality of image blocks;
  • the image encoding module is configured to: perform encoding processing on each image block in the plurality of image blocks to obtain encoding information corresponding to each image block;
  • the first labeling module is configured to: perform category labeling on some image blocks in the plurality of image blocks after encoding processing, to obtain labelled image blocks;
  • the category determination module is configured to: determine the category information corresponding to each image block based on the encoding information corresponding to each image block and the encoding information of the marked image block;
  • the second labeling module is configured to: label the target image based on the labeling method corresponding to the target image and the category information corresponding to each image block.
  • Embodiments of the present disclosure further provide an electronic device, including: a processor, a memory, and a bus, where the memory stores machine-readable instructions executable by the processor, and when the electronic device runs, the processor and the The memories communicate with each other through a bus, and when the machine-readable instructions are executed by the processor, the image labeling method as described in any preceding one is executed.
  • An embodiment of the present disclosure further provides a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and the computer program is executed by a processor to execute the image labeling method described in any preceding one.
  • the embodiments of the present disclosure also provide a computer program, the computer program includes computer-readable codes, and when the extremely computer-readable codes are executed in an electronic device, the processor of the electronic device executes the code for realizing Image annotation method as described in the previous one.
  • the image labeling method provided by the embodiments of the present disclosure can perform block processing on each target image to be labeled to obtain a plurality of image blocks, determine the encoding information corresponding to each image block, and further according to each image block
  • the coding information corresponding to the image block and the coding information of a small number of pre-labeled image blocks with categories can be used to determine the category information corresponding to each image block in the multiple image blocks.
  • the category information corresponding to the block completes the annotation of the target image. That is to say, in the implementation process of the image labeling method provided by the embodiments of the present disclosure, the labeling of the entire target image can be completed based on a small amount of labelled image blocks of labeling category information, which greatly saves labeling time and improves labeling efficiency.
  • the lesion area in the patient's organ image can be quickly labelled in the medical field, thereby effectively assisting the user to perform clinical diagnosis.
  • FIG. 1 is a flowchart of an image labeling method provided by an embodiment of the present disclosure
  • FIG. 2 is a flowchart of determining encoding information according to an embodiment of the present disclosure
  • FIG. 3 is a flowchart of a method for training a neural network provided by an embodiment of the present disclosure
  • FIG. 4 is a flowchart of a first specific image labeling method provided by an embodiment of the present disclosure
  • FIG. 5 is a flowchart of a second specific image labeling method provided by an embodiment of the present disclosure.
  • FIG. 6 is a flowchart of a second specific image labeling method provided by an embodiment of the present disclosure.
  • FIG. 7a is a schematic diagram of a lung image provided by an embodiment of the present disclosure.
  • FIG. 7b is a schematic diagram of annotated image blocks included in a lung image provided by an embodiment of the present disclosure.
  • FIG. 7c is a schematic diagram of labeling a lung image provided by an embodiment of the present disclosure.
  • FIG. 8 is a schematic structural diagram of an image labeling apparatus provided by an embodiment of the present disclosure.
  • FIG. 9 is a schematic structural diagram of an electronic device according to an embodiment of the present disclosure.
  • the training process of a neural network for image recognition requires the help of a large number of labeled image samples.
  • a large number of labeled information carrying the detection frame to complete the training process For example, for training a neural network for image detection, it needs to rely on a large amount of labeled information carrying the detection frame to complete the training process; for The neural network training process for instance segmentation needs to rely on a large number of image samples carrying instance outline annotation information. Therefore, in order to train a high-precision neural network, a large number of image samples with annotation information are required, and the annotation process of annotation information requires manual annotation, which means that it takes a lot of time to perform the image samples for each target object. callout. Therefore, the image labeling method in the related art consumes a long time and has low efficiency.
  • the present disclosure provides an image labeling method.
  • the target image can be processed into blocks to obtain a plurality of image blocks, and then according to the pre-trained neural network for coding network to determine the encoding information corresponding to each image block, and according to the encoding information corresponding to each image block and a small amount of encoding information of the marked image blocks with pre-marked category information, the corresponding image block of each of the multiple image blocks can be determined.
  • the annotation of the target image can be completed. That is to say, with the image labeling method provided by the embodiments of the present disclosure, the labeling of the entire target image can be completed based on a small number of labeling image blocks of labeling categories, which greatly saves labeling time and improves labeling efficiency.
  • the electronic device may be a computer device with a certain computing capability.
  • the computer device may include: a terminal device, a server, and other processing devices. Any of the devices; for example, the terminal device may be a user equipment (User Equipment, UE), a mobile device, a user terminal, a terminal, a cellular phone, a cordless phone, a Personal Digital Assistant (PDA), a handheld devices, computing devices, in-vehicle devices, wearable devices, etc.
  • UE user equipment
  • PDA Personal Digital Assistant
  • the image annotation method may be implemented by a processor invoking computer-readable instructions stored in a memory.
  • FIG. 1 is a flowchart of an image labeling method provided by an embodiment of the present disclosure. As shown in FIG. 1 , the method may include steps S101 to S106:
  • S101 Acquire a target image to be marked.
  • the target image may be a sample image used for training a neural network for image recognition; exemplarily, in the case of training a neural network for pedestrian detection, the target image may be a large number of pre-collected images containing pedestrians; Exemplarily, in the case of training a neural network for lung lesion identification, the target image may be a pre-acquired lung image.
  • the target image can be divided into blocks according to the set number of rows and columns to obtain multiple image blocks of the same size, or the target image can be divided into blocks with a preset size to obtain multiple image blocks with the preset size.
  • Image blocks with the same size each image block contains the same pixels.
  • S103 Perform encoding processing on each image block in the plurality of image blocks to obtain encoding information corresponding to each image block.
  • each image block can be encoded based on a pre-trained neural network for encoding, and the encoding information corresponding to the image block can be predicted; exemplarily, the encoding information corresponding to any two image blocks can be It is used to represent the similarity and/or distance information of the image features between any two image blocks. In this way, it can be determined whether the two image blocks belong to the same category according to the coding information of the two image blocks.
  • the image block is encoded by the encoding neural network, and the mapping relationship between the image feature of the image block and the encoding space can be constructed.
  • the image features corresponding to the image blocks may include at least one of the features that can represent the image content, such as texture features, spectral features, and color features of the image blocks.
  • S104 Perform category labeling on some image blocks in the plurality of image blocks after encoding processing, to obtain labeled image blocks.
  • the category information contained in the target images may be predetermined.
  • the category information may include benign categories and lesion categories; for pedestrians to be detected
  • the target image the category information can include pedestrian categories and non-pedestrian categories; for the target image to be labeled with instances, the category information in the target image can be the category corresponding to each instance; for example, for the target image of the road scene, the target image
  • the included category information may include vehicle category, pedestrian category, and road category.
  • some image blocks in the multiple image blocks may be classified in advance to obtain annotated image blocks for determining category information, so that the encoding information of each image block can be used to determine the type of image block. It is determined that the image blocks belong to the same category as the labeled image blocks, and the category information of the image blocks of the same category can be the same. In this way, the category information corresponding to each image block in the multiple image blocks included in the target image can be determined.
  • some image blocks in the multiple image blocks corresponding to the lung image can be classified, for example, annotating a number of image blocks corresponding to the category information as the lesion category, we can obtain: A number of annotated image blocks representing the lesion category; annotating a number of image blocks with corresponding category information as benign categories, several labeled image blocks representing benign categories can be obtained, and then based on the encoding information corresponding to each image block contained in the lung image, The category information of each image block is determined, that is, image blocks whose corresponding category information is a lesion category and an image block whose corresponding category information is a benign category are obtained in the lung image.
  • the labeling method may be determined in advance according to the use scene of the target image.
  • the labeling method may be a method of labeling a rectangular frame;
  • the labeling method may be the method of contour labeling; for the case where the category of the target image needs to be marked, the labeling method may be the method of classifying and labeling.
  • the target image can be labeled according to the corresponding labeling method of the target image.
  • the target image may be processed into blocks to obtain a plurality of image blocks, and the encoding information corresponding to each image block is determined, and further according to each image block
  • the coding information corresponding to each image block and a small number of coding information of pre-annotated category-marked image blocks can determine the category information corresponding to each image block in the multiple image blocks, and further based on the corresponding marking method of the target image and each image block.
  • the category information corresponding to the block completes the annotation of the target image.
  • the labeling of the entire target image can be completed based on a small amount of labelled image blocks of labeling category information, thereby greatly saving labeling time and improving labeling efficiency.
  • the image labeling method provided by the embodiments of the present disclosure the lesion area in the patient's organ image can be quickly labelled in the medical field, so that clinical diagnosis can be efficiently aided.
  • encoding processing is performed on each image block in the plurality of image blocks to obtain encoding information corresponding to each image block, which may be implemented through S1031 to S1032 as shown in FIG. 2 :
  • the pre-trained neural network for encoding can extract the image content contained in the image block.
  • the image content of the image block can be represented by image features.
  • the neural network can construct the mapping relationship between the image feature of the image block and the encoding space. Then, after extracting the image feature of the image block, the encoding information corresponding to the image feature can be obtained according to the pre-trained mapping relationship, so as to obtain the image.
  • the encoding information corresponding to the block can be obtained according to the pre-trained mapping relationship, so as to obtain the image.
  • the image block is processed by the pre-trained neural network for encoding, so that the mapping relationship between the image features and the encoding information can be established in advance, so that after the image features of the image block are extracted, the image block can be processed. Quickly determine the encoding information corresponding to the image block.
  • the pre-trained neural network for encoding may be implemented through S301 to S304 as shown in FIG. 3 :
  • S301 Acquire multiple sample images, and divide each sample image into blocks to obtain multiple sample image blocks and position information of each sample image block.
  • the process of segmenting multiple sample images to obtain multiple sample image blocks is the same as the above-mentioned method of obtaining multiple image blocks included in the target image, and will not be repeated here.
  • the position information of each sample image block may be represented by the position coordinates of the center point of the sample image block in the image coordinate system corresponding to the sample image.
  • the distance between the two sample image blocks in the first sample image block pair is less than or equal to the set threshold; the distance between the two sample image blocks in the second sample image block pair is greater than the set threshold.
  • the image features between sample image blocks that are close to each other in space are relatively similar, and the probability of belonging to the same category of information is high; the image features between sample image blocks that are far apart in space may be are not similar, the probability of belonging to the same category of information is small, so the first sample image block pair and the second sample image block pair can be constructed based on the distance information between the sample image blocks.
  • the two image blocks of the frame sample image and the distance less than or equal to the set threshold are taken as the first sample image pair, and the two image blocks belonging to the same frame sample image and the distance greater than the set threshold, or the two image blocks belonging to different frame sample images.
  • the two sample image patches serve as the second sample image pair.
  • the image features of the two sample image blocks can be obtained respectively, and based on the two sample image blocks
  • prediction coding information corresponding to the two sample image blocks can be obtained.
  • an unsupervised clustering algorithm can be introduced to train the neural network for encoding;
  • the first The distance between the predictive coding information corresponding to the two sample image blocks included in this image block pair is gradually reduced, so that the distance between the predictive coding information corresponding to the two sample image blocks included in the second sample image block pair is gradually enlarged;
  • the image features corresponding to each image block can be adjusted at the same time;
  • the obtained mapping relationship between image features and encoding space can indicate that the encoding information corresponding to similar image blocks is closer in the encoding space, and dissimilar image blocks are closer in the encoding space.
  • the corresponding encoded information is far away in the encoding space, and at this time, the trained neural network for
  • the encoded information may be represented by a vector, and the distance between the encoded information corresponding to two image blocks may be determined by a cosine distance formula.
  • a pair of first sample image blocks whose mutual distance is less than or equal to a set threshold and a second sample image block whose mutual distance is greater than the set threshold are introduced. Yes, the neural network is trained.
  • the network parameters can be accurately obtained by adjusting the network parameters based on the training criteria with high similarity of image features between the sample image blocks that are close in space.
  • a neural network that determines the encoded information corresponding to the image block based on the image block.
  • the category information corresponding to each image block can be determined by introducing a semi-supervised learning algorithm, and exemplarily, the category information, encoding information, and encoding space distribution information of a given labeled image block can be obtained.
  • the coding space distribution information it is possible to reflect the position distribution in the coding space of the coding information corresponding to the multiple image blocks included in the target image, and the higher the similarity of the image features between the two image blocks, The larger the corresponding distance in the coding space, the coding information corresponding to the two image blocks has a probability of being close; or, the coding space distribution can be a clustering distribution obtained after clustering processing based on the coding information corresponding to multiple image blocks, so that, When the target image contains target objects of various categories, the coding space distribution corresponding to the target image may contain multiple clusters, and the image blocks contained in each cluster have a high probability of belonging to the same category of information.
  • the category information corresponding to other encoding information contained in the cluster can be determined, that is, the corresponding category information of each image block in the multiple image blocks contained in the target image can be obtained.
  • Category information After determining the category information corresponding to the encoding information contained in one of the clusters, the category information corresponding to other encoding information contained in the cluster can be determined, that is, the corresponding category information of each image block in the multiple image blocks contained in the target image can be obtained. Category information.
  • marking the target image based on the labeling method corresponding to the target image and the category information corresponding to each image block can be implemented through S1061 to S1062 as shown in FIG. 4 :
  • S1062 Mark the target image according to the minimum peripheral rectangular frame of the image blocks corresponding to the same category information.
  • a plurality of image blocks with the same category information may be included.
  • the image blocks with the same category information may be searched in the manner of a single-connected domain search to obtain an image with the same category information.
  • the minimum surrounding rectangle corresponding to the block is then marked according to the minimum surrounding rectangle.
  • an image block in the lung image whose category information is a lesion can be marked to obtain a lesion area in the lung image.
  • the labeling of the image blocks with the same category information included in the target image can be completed. This process does not require the user to manually mark the rectangle frame of each target object, which can greatly save the marking time and improve the marking efficiency.
  • marking the target image based on the labeling method corresponding to the target image and the category information corresponding to each image block can be implemented through S1063 to S1066 as shown in FIG. 5 :
  • category information corresponding to each pixel included in the target image may be determined.
  • the category information of the image block can be used as the category information corresponding to each pixel included in the image block.
  • the category information corresponding to an image block is a lesion category
  • the category information corresponding to all the included pixels may be lesion categories; for example, when the image block is an image block at the edge of the target object, the category information of the pixels included in the image block may be different.
  • the category information corresponding to the image block is used as the category information corresponding to each pixel included in the image block, in order to improve the accuracy of the category information of the pixel, the category information of some pixels, especially the target object The category information corresponding to the edge pixels needs to be further adjusted, as described later.
  • S1064 Acquire attribute features of each pixel in the target image, and determine the target pixel based on category information and attribute features corresponding to each pixel.
  • the target pixel is the pixel to be adjusted for category information.
  • a conditional random field model may be introduced, and the conditional random field model is used to determine whether there is a target pixel to be adjusted for category information, and to be adjusted.
  • the category information of the target pixel for category information adjustment is adjusted.
  • the attribute features of each pixel included in the target image can be extracted, and the attribute features between different pixels can be used to represent the difference information between these pixels, such as texture differences, gradient differences, grayscale values. Difference information such as difference, because the pixels with inaccurate category information are likely to be pixels on the edge of the target object in the target image, so the pixels on the edge of the target object in the target image can be filtered out based on the attribute features corresponding to each pixel. point.
  • the category information corresponding to two pixels with the same attribute feature is likely to be consistent. If there is a pixel with the same attribute feature as a certain pixel on the edge of the target object, but the corresponding category information is inconsistent, the pixel can be considered. The point is the target pixel to be adjusted for category information.
  • the category information of the target pixel can be analyzed based on the category information of other pixels with the same attribute feature as the target pixel. After adjusting the category information corresponding to the target pixel point, the target category information corresponding to each pixel point in the target image is obtained.
  • the contour of the region formed by pixels belonging to the same category information can be annotated through the target category information corresponding to each pixel in the target image, so that the contour annotation of the target object contained in the target image can be completed.
  • step S1064 if it is determined that there is no target pixel, based on the category information corresponding to each pixel in the target image, the outline of the target object formed by pixels belonging to the same target category is marked.
  • This situation can indicate that the prediction of the category information of the pixel points on the edge of the target object is relatively accurate, and there is no need to adjust it.
  • the corresponding labeling process for the target object in this situation is similar to that described above, and will not be repeated here. .
  • the target category information corresponding to each pixel can be accurately determined based on the category information and attribute features corresponding to each pixel included in the target image, thereby The segmentation and annotation results with higher accuracy are obtained.
  • S10641 to S10643 may be used to implement:
  • S10641 Select at least one of each pixel point as the first pixel point; based on the attribute feature of the first pixel point, determine the difference value of the attribute feature of the first pixel point and the second pixel point.
  • the second pixel is adjacent to the first pixel.
  • the first pixel point and the second pixel point refer to the pixel points adjacent to the pixel coordinates of the target image.
  • the difference value of the attribute feature of each first pixel point and the second pixel point can be determined through the conditional random field model mentioned above.
  • the category information of some pixel points serving as the edge of the target object may be adjusted, and the adjustment process may be based on the difference between adjacent pixel points.
  • the difference value of the attribute feature is greater than a preset threshold determines the pixel points on the edge of the target object; exemplarily, the preset threshold value can be preset, or can be determined when the pixel points on the edge of the target object are determined based on the conditional random field model of.
  • the difference value of the attribute feature of each pixel and at least one adjacent pixel is greater than a preset threshold, so that more needs to be carried out can be found.
  • the number of adjacent pixels to be compared with the pixel to be compared with the attributes may also be set, which is not limited in this embodiment of the present disclosure.
  • the third pixel point is a pixel point having the same attribute characteristics as the first pixel point.
  • the first pixel point when it is determined that the difference value of the attribute feature of the first pixel point and the adjacent second pixel point is greater than a preset threshold, the first pixel point can be used as a candidate pixel point to be adjusted for category information. , these candidate pixels are likely to be pixels on the edge of the target object.
  • the category information corresponding to the pixels with the same attribute features is consistent. Therefore, in the case where it is determined that the difference value of the attribute features of the first pixel point and the adjacent second pixel point is greater than the preset threshold, it is possible to further It is judged whether the category information corresponding to the first pixel point and the category information of the third pixel point having the same attribute feature as the pixel point are the same.
  • the category information corresponding to the first pixel point A is the lesion category, and the category information of several other third pixel points that have the same attribute characteristics as the first pixel point A are benign categories, then the first pixel point
  • the category information of A has a relatively high probability of being a benign category, so the first pixel point A can be used as the target pixel point to be adjusted for category information.
  • the target pixel to be adjusted for the category information can be quickly determined through the attribute features and category information between adjacent pixels. is larger, and the category information of the pixel is different from that of other pixels with the same attribute characteristics, then it can be determined that the category information of the pixel is wrong with a high probability, so the category to be processed can be quickly determined in this way.
  • the target pixel for information adjustment can be quickly determined through the attribute features and category information between adjacent pixels. is larger, and the category information of the pixel is different from that of other pixels with the same attribute characteristics, then it can be determined that the category information of the pixel is wrong with a high probability, so the category to be processed can be quickly determined in this way.
  • the target pixel for information adjustment can be quickly determined through the attribute features and category information between adjacent pixels. is larger, and the category information of the pixel is different from that of other pixels with the same attribute characteristics, then it can be determined that the category information of the pixel is wrong with a high probability, so the category to be processed can be quickly determined in this way.
  • marking the target image based on the labeling method corresponding to the target image and the category information corresponding to each image block can be implemented through S1067-S1068 as shown in FIG. 6 :
  • S1068 Determine the category information of the target image based on the number of image blocks corresponding to each category of information.
  • the category information of the entire target image needs to be determined, the number of image blocks corresponding to each category of information contained in the target image needs to be classified and counted, and then the category of the image block containing the maximum number of image blocks can be classified. information as the category information of the target image.
  • a threshold condition for setting the number can also be added, such as the number of image blocks satisfying any category information. Under the condition that the number reaches the set number threshold and the number of image blocks corresponding to any category information is the largest, any category information can be used as category information of the target image.
  • the category information of the target image can be quickly determined.
  • the category information of the annotated image block is updated in response to the annotation category update instruction for the target image block; the step of performing the above-mentioned S105 is returned, that is, based on the coding information corresponding to each image block and the information of the annotated image block.
  • updating the category information of annotated image blocks may include the following situations:
  • the annotation results can be fine-tuned to obtain more accurate annotation results.
  • step S105 more accurate category information corresponding to each image block can be obtained, so that the target image can be marked based on the more accurate category information.
  • the target image contains multiple target objects, and the initial labeling category information only includes labeling the image block included in one of the target objects, then the target image obtained in this way
  • the labeling result only contains the category information for the target object, that is, the labeling result is not complete.
  • the labeling image blocks corresponding to other target objects can be added, and then return to the above step S105, so that a more complete picture can be obtained.
  • the category information of the image block, so that a more complete annotation result corresponding to the target image can be obtained.
  • the specific method is the result of the above two methods, and this method can improve the accuracy and completeness of the target image annotation at the same time.
  • the category information of the annotated image block may be updated based on the annotation result of the target image, thereby improving the accuracy and/or completeness of the annotation result of the target image.
  • the category information corresponding to the image block can be readjusted based on the marking result, so as to obtain a more accurate marking result.
  • the target image is a lung image of a patient, and the lung image is divided into blocks to obtain multiple lung image blocks (not shown in Fig. 7a), the dark color in Fig. 7b
  • the rectangular area is the category information corresponding to the labeled image blocks of the manually labeled category.
  • the category information corresponding to the labeled image block is the lesion category.
  • Image block and further label the lung image based on the category information corresponding to each image block in the lung image, and the labeling result for the target object can be obtained, for example, the labeling result shown in Figure 7c is obtained, and the labeling result is a lesion Outline map of the area.
  • the writing order of each step does not mean a strict execution order but constitutes any limitation on the implementation process, and the specific execution order of each step should be based on its function and possible Internal logic is determined.
  • the embodiment of the present disclosure also provides an image labeling device corresponding to the image labeling method. Reference may be made to the implementation of the method, and repeated descriptions will not be repeated.
  • the image labeling apparatus 800 includes:
  • the image acquisition module 801 is configured to: acquire the target image to be marked;
  • the image segmentation module 802 is configured to: segment the target image to obtain multiple image blocks;
  • the image encoding module 803 is configured to: perform encoding processing on each image block in the plurality of image blocks to obtain encoding information corresponding to each image block;
  • the first labeling module 804 is configured to: perform category labeling on part of the image blocks in the plurality of image blocks after encoding processing, to obtain labelled image blocks;
  • the category determining module 805 is configured to: determine the category information corresponding to each image block based on the encoding information corresponding to each image block and the encoding information annotating the image block;
  • the second labeling module 806 is configured to label the target image based on the labeling manner corresponding to the target image and the category information corresponding to each image block.
  • the image encoding module 803 is configured to: input each image block into a neural network, extract image features included in each image block through the neural network; encoding information.
  • the second labeling module 806 is configured to: when the labeling method is to label a rectangular frame, obtain image blocks with the same corresponding category information; The target image is annotated.
  • the second labeling module 806 is configured to: when the labeling method is contour labeling, determine each pixel in the target image based on the category information corresponding to each image block and the pixels contained in each image block Corresponding category information; obtain the attribute features of each pixel in the target image, and determine the target pixel based on the category information and attribute features corresponding to each pixel, wherein the target pixel is the pixel to be adjusted for category information; in In the presence of target pixels, the category information corresponding to the target pixels is adjusted based on the category information of the pixels with the same attribute characteristics as the target pixels, and the target category information corresponding to each pixel in the target image is obtained; The target category information corresponding to each pixel in the image marks the contour of the target object composed of pixels belonging to the same target category.
  • the second labeling module 806 is configured to: select at least one of the respective pixel points as the first pixel point; based on the attribute characteristics of the first pixel point, determine the attributes of the first pixel point and the second pixel point The difference value of the feature; when the difference value is greater than the preset threshold, at least one third pixel point is selected, wherein the third pixel point is a pixel point with the same attribute feature as the first pixel point; in the first pixel point When the corresponding category information is inconsistent with the category information corresponding to the third pixel point, the first pixel point is used as the target pixel point; wherein the second pixel point is adjacent to the first pixel point.
  • the second labeling module is configured to: when the labeling method is to perform classification labeling, determine the number of image blocks corresponding to each class of information based on the class information corresponding to each image block; The number of image blocks corresponding to the information determines the category information of the target image.
  • the category determination module 805 is configured to: after annotating the target image, in response to an annotation category update instruction for the target image block, update the category information of the annotated image block; The step of determining the type information corresponding to each image block.
  • the image labeling apparatus 800 further includes a network training module 807, and the network training module 807 is configured to: acquire multiple sample images, and divide each sample image into blocks to obtain multiple sample image blocks and position information of each sample image block; based on the position information of each sample image block, determine the first sample image block pair and the second sample image block pair, wherein the two sample images in the first sample image block pair The distance between the blocks is less than or equal to the set threshold, and the distance between the two sample image blocks in the second sample image block pair is greater than the set threshold; the first sample image block pair and the second sample image block are respectively For the input neural network to be trained, the predictive coding information corresponding to each sample image block is obtained; based on the predictive coding information corresponding to each sample image block, the network parameters of the neural network to be trained are adjusted, and the training completed is obtained. Encoded neural network.
  • an embodiment of the present disclosure further provides an electronic device 900 .
  • the schematic structural diagram of the electronic device 900 provided by the embodiment of the present disclosure includes:
  • the communication between the processor 91 and the memory 92 is through the bus 93, so that the processor 91 executes the following instructions : obtain the target image to be marked; divide the target image into blocks to obtain multiple image blocks; perform coding processing on each of the multiple image blocks to obtain the coding information corresponding to each image block; Part of the image blocks in the image blocks are classified into categories to obtain labeled image blocks; based on the encoding information corresponding to each image block and the encoding information of the labeled image blocks, the category information corresponding to each image block is determined; and, based on the annotation corresponding to the target image The method and the corresponding category information of each image block are used to annotate the target image.
  • Embodiments of the present disclosure further provide a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and when the computer program is run by a processor, the steps of the image labeling method described in the foregoing method embodiments are executed.
  • the storage medium may be a volatile or non-volatile computer-readable storage medium.
  • An embodiment of the present disclosure further provides a computer program, the computer program product includes computer code, and when the computer code runs in an electronic device, the processor of the electronic device can execute the image labeling method described in any of the preceding embodiments, For details, reference may be made to the foregoing method embodiments, which will not be repeated here.
  • the above-mentioned computer program product can be specifically implemented by means of hardware, software or a combination thereof.
  • the computer program product is embodied as a computer storage medium, and in another optional embodiment, the computer program product is embodied as a software product, such as a software development kit (Software Development Kit, SDK), etc. Wait.
  • the units described as separate components may or may not be physically separated, and components displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution in this embodiment.
  • each functional unit in each embodiment of the present disclosure may be integrated into one processing unit, or each unit may exist physically alone, or two or more units may be integrated into one unit.
  • the functions, if implemented in the form of software functional units and sold or used as stand-alone products, may be stored in a processor-executable non-volatile computer-readable storage medium.
  • the computer software products are stored in a storage medium, including Several instructions are used to cause a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in various embodiments of the present disclosure.
  • the aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), magnetic disk or optical disk and other media that can store program codes .
  • the embodiments of the present disclosure disclose an image labeling method, device, electronic device, storage medium and program, the method includes: acquiring a target image to be labelled; dividing the target image into blocks to obtain a plurality of image blocks; Perform encoding processing on each image block in the plurality of image blocks to obtain encoding information corresponding to each image block; perform category labeling on some image blocks in the plurality of image blocks after encoding processing to obtain labeled image blocks ; Based on the coding information corresponding to each image block and the coding information of the labeled image block, determine the category information corresponding to each image block; Based on the corresponding labeling method of the target image and the corresponding category of each image block information, and annotate the target image.
  • the image labeling method provided by the embodiments of the present disclosure, the lesion area in the patient's organ image can be quickly labelled in the medical field, thereby effectively assisting the user in clinical diagnosis.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Health & Medical Sciences (AREA)
  • Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • General Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Health & Medical Sciences (AREA)
  • Medical Informatics (AREA)
  • Artificial Intelligence (AREA)
  • Public Health (AREA)
  • Databases & Information Systems (AREA)
  • Primary Health Care (AREA)
  • Epidemiology (AREA)
  • Radiology & Medical Imaging (AREA)
  • Nuclear Medicine, Radiotherapy & Molecular Imaging (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Library & Information Science (AREA)
  • Biomedical Technology (AREA)
  • Biophysics (AREA)
  • Computational Linguistics (AREA)
  • Evolutionary Computation (AREA)
  • Molecular Biology (AREA)
  • Computing Systems (AREA)
  • Mathematical Physics (AREA)
  • Software Systems (AREA)
  • Image Analysis (AREA)

Abstract

An image annotation method and apparatus, an electronic device, a storage medium, and a program. The image annotation method comprises: obtaining a target image to be annotated (S101); partitioning the target image to obtain a plurality of image blocks (S102); performing encoding processing on each of the plurality of image blocks to obtain encoding information corresponding to each image block (S103); performing category annotation on some of the plurality of encoded image blocks to obtain annotated image blocks (S104); determining category information corresponding to each image block on the basis of the encoding information corresponding to each image block and the encoding information of the annotated image block (S105); and annotating the target image on the basis of the annotation mode corresponding to the target image and the category information corresponding to each image block (S106). According to the image annotation method, a lesion area in an organ image of a patient can be quickly annotated in the medical field, such that a user is effectively assisted in clinical diagnosis.

Description

图像标注方法、装置、电子设备、存储介质及程序Image annotation method, device, electronic device, storage medium and program
相关申请的交叉引用CROSS-REFERENCE TO RELATED APPLICATIONS
本公开基于申请号为202110116990.5、申请日为2021年1月28日、申请名称为“一种图像标注方法、装置、电子设备及存储介质”的中国专利申请提出,并要求上述中国专利申请的优先权,上述中国专利申请的全部内容在此引入本公开作为参考。The present disclosure is based on the Chinese patent application with the application number of 202110116990.5, the application date of January 28, 2021, and the application title of "An Image Annotation Method, Device, Electronic Device and Storage Medium", and requires the priority of the above-mentioned Chinese patent application The entire contents of the above-mentioned Chinese patent application are hereby incorporated into the present disclosure by reference.
技术领域technical field
本公开涉及图像识别技术领域,具体而言,涉及但不限于一种图像标注方法、装置、电子设备、存储介质及程序。The present disclosure relates to the technical field of image recognition, in particular, but not limited to, an image labeling method, apparatus, electronic device, storage medium and program.
背景技术Background technique
随着人工神经网络研究工作的不断深入,人工神经网络的应用领域已经取得了很大的扩展,比如在图像识别领域,可以训练对图像进行识别的神经网络,比如训练对图像进行目标检测的神经网络,该神经网络可以通过检测框标注出图像中的目标对象;比如可以训练对图像进行语义分割的神经网络,该神经网络可以确定出图像中目标对象的轮廓。With the continuous deepening of artificial neural network research, the application field of artificial neural network has been greatly expanded. For example, in the field of image recognition, a neural network for image recognition can be trained, such as a neural network for image target detection. The neural network can mark the target object in the image through the detection frame; for example, a neural network can be trained for semantic segmentation of the image, and the neural network can determine the contour of the target object in the image.
在训练对图像进行识别的神经网络时,需要获取大量的训练样本,且每一训练样本中均需要携带有精确的标注信息才能满足神经网络的训练需求。这些标注信息包括目标对象的检测框标注数据,目标对象的轮廓标注数据等,这些标注信息的标注通常需要大量手动标注进行操作。When training a neural network for image recognition, a large number of training samples need to be obtained, and each training sample needs to carry accurate annotation information to meet the training requirements of the neural network. The annotation information includes the detection frame annotation data of the target object, the outline annotation data of the target object, etc. The annotation of these annotation information usually requires a lot of manual annotation operations.
发明内容SUMMARY OF THE INVENTION
本公开实施例提供了一种图像标注方法、装置、电子设备、存储介质及程序。Embodiments of the present disclosure provide an image labeling method, apparatus, electronic device, storage medium, and program.
本公开实施例的技术方案是这样实现的:The technical solutions of the embodiments of the present disclosure are implemented as follows:
本公开实施例提供了一种图像标注方法,所述方法包括:An embodiment of the present disclosure provides an image labeling method, the method comprising:
获取待进行标注的目标图像;Obtain the target image to be annotated;
对所述目标图像进行分块,得到多个图像块;The target image is divided into blocks to obtain a plurality of image blocks;
对所述多个图像块中的每一图像块进行编码处理,得到各图像块对应的编码信息;performing encoding processing on each image block in the plurality of image blocks to obtain encoding information corresponding to each image block;
对编码处理后的所述多个图像块中的部分图像块进行类别标注,得到标注图像块;Perform category labeling on some image blocks in the plurality of image blocks after encoding processing, to obtain labeled image blocks;
基于所述各图像块对应的编码信息以及所述标注图像块的编码信息,确定所述各图像块对应的类别信息;determining the category information corresponding to each image block based on the encoding information corresponding to each image block and the encoding information of the marked image block;
基于所述目标图像对应的标注方式以及所述各图像块对应的类别信息,对所述目标图像进行标注。The target image is annotated based on the labeling manner corresponding to the target image and the category information corresponding to each image block.
在本公开的一些实施例中,所述对所述多个图像块中的每一图像块进行编码处理,得到各图像块对应的编码信息,包括:In some embodiments of the present disclosure, performing encoding processing on each image block in the plurality of image blocks to obtain encoding information corresponding to each image block includes:
将所述各图像块输入神经网络,通过所述神经网络提取所述各图像块包含的图像特征;以及Inputting the image blocks into a neural network, and extracting the image features contained in the image blocks through the neural network; and
通过所述神经网络,基于所述各图像块的图像特征确定所述各图像块对应的编码信息。Through the neural network, the coding information corresponding to each image block is determined based on the image feature of each image block.
在本公开的一些实施例中,所述基于所述目标图像对应的标注方式以及所述各图像块对应的类别信息,对所述目标图像进行标注,包括:In some embodiments of the present disclosure, the labeling of the target image based on the labeling manner corresponding to the target image and the category information corresponding to each image block includes:
在所述标注方式为进行矩形框标注的情况下,获取对应类别信息相同的图像块;In the case where the labeling method is to label a rectangular frame, obtain image blocks with the same corresponding category information;
按照所述对应类别信息相同的图像块的最小外围矩形框对所述目标图像进行标注。The target image is marked according to the smallest peripheral rectangular frame of the image blocks with the same corresponding category information.
在本公开的一些实施例中,所述基于所述目标图像对应的标注方式以及所述各图像块对应的类别信息,对所述目标图像进行标注,包括:In some embodiments of the present disclosure, the labeling of the target image based on the labeling manner corresponding to the target image and the category information corresponding to each image block includes:
在所述标注方式为进行轮廓标注的情况下,基于所述各图像块对应的类别信息以及所述各图像块包含的像素点,确定所述目标图像中各个像素点对应的类别信息;In the case where the labeling method is contour labeling, the class information corresponding to each pixel point in the target image is determined based on the class information corresponding to each image block and the pixel points included in each image block;
获取所述目标图像中各个像素点的属性特征,并基于所述各个像素点对应的类别信息以及属性特 征,确定目标像素点;其中,所述目标像素点为待进行类别信息调整的像素点;Obtain the attribute features of each pixel in the target image, and determine the target pixel based on the corresponding category information and the attribute feature of the each pixel; Wherein, the target pixel is the pixel to be adjusted for category information;
在存在所述目标像素点的情况下,基于与所述目标像素点对应属性特征相同的像素点的类别信息,对所述目标像素点对应的类别信息进行调整,得到所述目标图像中各个像素点对应的目标类别信息;In the case where the target pixel exists, the category information corresponding to the target pixel is adjusted based on the category information of the pixel with the same attribute feature as the target pixel to obtain each pixel in the target image. The target category information corresponding to the point;
基于所述目标图像中所述各个像素点对应的目标类别信息,对属于同一目标类别的像素点构成的目标对象的轮廓进行标注。Based on the target category information corresponding to each pixel in the target image, an outline of a target object formed by pixels belonging to the same target category is marked.
在本公开的一些实施例中,所述基于各个像素点对应的类别信息以及属性特征,确定目标像素点,包括:In some embodiments of the present disclosure, determining the target pixel based on the category information and attribute features corresponding to each pixel includes:
选择所述各个像素点中的至少一个作为第一像素点;Selecting at least one of the respective pixel points as the first pixel point;
基于所述第一像素点的属性特征,确定所述第一像素点与第二像素点的属性特征的差异值;其中,所述第二像素点,与所述第一像素点相邻;Based on the attribute feature of the first pixel point, the difference value of the attribute feature of the first pixel point and the second pixel point is determined; wherein, the second pixel point is adjacent to the first pixel point;
在所述差异值大于预设阈值的情况下,选择至少一个第三像素点;其中,所述第三像素点为具有与所述第一像素点相同的属性特征的像素点;In the case that the difference value is greater than the preset threshold, at least one third pixel is selected; wherein, the third pixel is a pixel with the same attribute feature as the first pixel;
在所述第一像素点对应的类别信息与所述第三像素点对应的类别信息不一致的情况下,将所述第一像素点作为所述目标像素点。When the category information corresponding to the first pixel point is inconsistent with the category information corresponding to the third pixel point, the first pixel point is used as the target pixel point.
在本公开的一些实施例中,所述基于所述目标图像对应的标注方式以及所述各图像块对应的类别信息,对所述目标图像进行标注,包括:In some embodiments of the present disclosure, the labeling of the target image based on the labeling manner corresponding to the target image and the category information corresponding to each image block includes:
在所述标注方式为进行分类标注的情况下,基于各图像块对应的类别信息,确定每种类别信息对应的图像块个数;In the case that the labeling method is to perform classification labeling, based on the category information corresponding to each image block, determine the number of image blocks corresponding to each category information;
基于每种类别信息对应的图像块个数,确定所述目标图像的类别信息。The category information of the target image is determined based on the number of image blocks corresponding to each category of information.
在本公开的一些实施例中,所述图像标注方法还包括:In some embodiments of the present disclosure, the image labeling method further includes:
对所述目标图像进行标注后,响应于针对目标图像块的标注类别更新指示,对所述标注图像块的类别信息进行更新;After the target image is marked, in response to the marking category update instruction for the target image block, update the category information of the marked image block;
返回执行基于所述各图像块对应的编码信息以及所述标注图像块的编码信息,确定所述各图像块对应的类别信息的步骤。Return to perform the step of determining the category information corresponding to each image block based on the encoding information corresponding to each image block and the encoding information of the marked image block.
在本公开的一些实施例中,所述神经网络是通过以下方式得到的:In some embodiments of the present disclosure, the neural network is obtained by:
获取多个样本图像,并对每个样本图像进行分块,得到多个样本图像块以及每个样本图像块的位置信息;Acquire multiple sample images, and divide each sample image into blocks to obtain multiple sample image blocks and position information of each sample image block;
基于每个样本图像块的位置信息,确定第一样本图像块对以及第二本图像块对;其中,所述第一样本图像块对中的两个样本图像块之间的距离小于或等于设定阈值,以及所述第二样本图像块对中的两个样本图像块之间的距离大于所述设定阈值;Based on the position information of each sample image block, a first sample image block pair and a second native image block pair are determined; wherein the distance between the two sample image blocks in the first sample image block pair is less than or is equal to a set threshold, and the distance between two sample image blocks in the second sample image block pair is greater than the set threshold;
分别将所述第一样本图像块对以及所述第二样本图像块对输入待训练的神经网络,得到每个样本图像块对应的预测编码信息;respectively inputting the first sample image block pair and the second sample image block pair into the neural network to be trained, to obtain predictive coding information corresponding to each sample image block;
基于每个样本图像块对应的预测编码信息,对所述待训练的神经网络的网络参数进行调整,得到训练完成的用于进行编码的神经网络。Based on the predictive coding information corresponding to each sample image block, the network parameters of the neural network to be trained are adjusted to obtain a trained neural network for coding.
本公开实施例还提供了一种图像标注装置,包括:The embodiment of the present disclosure also provides an image labeling device, including:
图像获取模块配置为:获取待进行标注的目标图像;The image acquisition module is configured to: acquire the target image to be marked;
图像切分模块配置为:对所述目标图像进行分块,得到多个图像块;The image segmentation module is configured to: block the target image to obtain a plurality of image blocks;
图像编码模块配置为:对所述多个图像块中的每一图像块进行编码处理,得到各图像块对应的编码信息;The image encoding module is configured to: perform encoding processing on each image block in the plurality of image blocks to obtain encoding information corresponding to each image block;
第一标注模块配置为:对编码处理后的所述多个图像块中的部分图像块进行类别标注,得到标注图像块;The first labeling module is configured to: perform category labeling on some image blocks in the plurality of image blocks after encoding processing, to obtain labelled image blocks;
类别确定模块配置为:基于各图像块对应的编码信息以及所述标注图像块的编码信息,确定各图像块对应的类别信息;The category determination module is configured to: determine the category information corresponding to each image block based on the encoding information corresponding to each image block and the encoding information of the marked image block;
第二标注模块配置为:基于所述目标图像对应的标注方式以及所述各图像块对应的类别信息,对 所述目标图像进行标注。The second labeling module is configured to: label the target image based on the labeling method corresponding to the target image and the category information corresponding to each image block.
本公开实施例还提供了一种电子设备,包括:处理器、存储器和总线,所述存储器存储有所述处理器可执行的机器可读指令,当电子设备运行时,所述处理器与所述存储器之间通过总线通信,所述机器可读指令被所述处理器执行时执行如前任一所述的图像标注方法。Embodiments of the present disclosure further provide an electronic device, including: a processor, a memory, and a bus, where the memory stores machine-readable instructions executable by the processor, and when the electronic device runs, the processor and the The memories communicate with each other through a bus, and when the machine-readable instructions are executed by the processor, the image labeling method as described in any preceding one is executed.
本公开实施例还提供了一种计算机可读存储介质,所述计算机可读存储介质上存储有计算机程序,该计算机程序被处理器运行时执行如前任一所述的图像标注方法。An embodiment of the present disclosure further provides a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and the computer program is executed by a processor to execute the image labeling method described in any preceding one.
本公开实施例还提供了一种计算机程序,所述计算机程序包括计算机可读代码,在所述极计算机可读代码在电子设备中运行的情况下,所述电子设备的处理器执行用于实现如前任一所述的图像标注方法。The embodiments of the present disclosure also provide a computer program, the computer program includes computer-readable codes, and when the extremely computer-readable codes are executed in an electronic device, the processor of the electronic device executes the code for realizing Image annotation method as described in the previous one.
本公开实施例提供的图像标注方法,针对每个待标注的目标图像,能够对该目标图像进行分块处理,得到多个图像块,并确定每个图像块对应的编码信息,进一步根据每个图像块对应的编码信息,以及少量的预先标注类别的标注图像块的编码信息,就能够确定多个图像块中每个图像块对应的类别信息,进一步可以基于目标图像对应的标注方式和各图像块对应的类别信息完成对目标图像的标注。也就是说,本公开实施例提供的图像标注方法实现过程中,基于少量的标注类别信息的标注图像块即可以完成对整张目标图像的标注,大大节省了标注时间,提高了标注效率。示例性地,通过使用本公开实施例提供的图像标注方法能够在医疗领域中快速标注出病人器官图像中的病灶区域,有效辅助用户进行临床诊断。The image labeling method provided by the embodiments of the present disclosure can perform block processing on each target image to be labeled to obtain a plurality of image blocks, determine the encoding information corresponding to each image block, and further according to each image block The coding information corresponding to the image block and the coding information of a small number of pre-labeled image blocks with categories can be used to determine the category information corresponding to each image block in the multiple image blocks. The category information corresponding to the block completes the annotation of the target image. That is to say, in the implementation process of the image labeling method provided by the embodiments of the present disclosure, the labeling of the entire target image can be completed based on a small amount of labelled image blocks of labeling category information, which greatly saves labeling time and improves labeling efficiency. Exemplarily, by using the image labeling method provided by the embodiments of the present disclosure, the lesion area in the patient's organ image can be quickly labelled in the medical field, thereby effectively assisting the user to perform clinical diagnosis.
为使本公开的上述目的、特征和优点能更明显易懂,下文特举较佳实施例,并配合所附附图,作详细说明如下。In order to make the above-mentioned objects, features and advantages of the present disclosure more obvious and easy to understand, the preferred embodiments are exemplified below, and are described in detail as follows in conjunction with the accompanying drawings.
附图说明Description of drawings
为了更清楚地说明本公开实施例的技术方案,下面将对实施例中所需要使用的附图作简单地介绍,此处的附图被并入说明书中并构成本说明书中的一部分,这些附图示出了符合本公开的实施例,并与说明书一起用于说明本公开的技术方案。应当理解,以下附图仅示出了本公开的某些实施例,因此不应被看作是对范围的限定,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他相关的附图。In order to explain the technical solutions of the embodiments of the present disclosure more clearly, the following briefly introduces the accompanying drawings required in the embodiments, which are incorporated into the specification and constitute a part of the specification. The drawings illustrate embodiments consistent with the present disclosure, and together with the description serve to explain the technical solutions of the present disclosure. It should be understood that the following drawings only show some embodiments of the present disclosure, and therefore should not be regarded as limiting the scope. Other related figures are obtained from these figures.
图1为本公开实施例所提供的一种图像标注方法的流程图;FIG. 1 is a flowchart of an image labeling method provided by an embodiment of the present disclosure;
图2为本公开实施例所提供的一种确定编码信息的流程图;FIG. 2 is a flowchart of determining encoding information according to an embodiment of the present disclosure;
图3为本公开实施例所提供的一种训练神经网络的方法流程图;3 is a flowchart of a method for training a neural network provided by an embodiment of the present disclosure;
图4为本公开实施例所提供的第一种具体的图像标注方法流程图;4 is a flowchart of a first specific image labeling method provided by an embodiment of the present disclosure;
图5为本公开实施例所提供的第二种具体的图像标注方法流程图;5 is a flowchart of a second specific image labeling method provided by an embodiment of the present disclosure;
图6为本公开实施例所提供的第二种具体的图像标注方法流程图;6 is a flowchart of a second specific image labeling method provided by an embodiment of the present disclosure;
图7a为本公开实施例所提供的一种肺部图像示意图;7a is a schematic diagram of a lung image provided by an embodiment of the present disclosure;
图7b为本公开实施例所提供的一种肺部图像包含的标注图像块的示意图;7b is a schematic diagram of annotated image blocks included in a lung image provided by an embodiment of the present disclosure;
图7c为本公开实施例所提供的一种肺部图像的标注示意图;FIG. 7c is a schematic diagram of labeling a lung image provided by an embodiment of the present disclosure;
图8为本公开实施例所提供的一种图像标注装置的结构示意图;FIG. 8 is a schematic structural diagram of an image labeling apparatus provided by an embodiment of the present disclosure;
图9为本公开实施例所提供的一种电子设备的结构示意图。FIG. 9 is a schematic structural diagram of an electronic device according to an embodiment of the present disclosure.
具体实施方式Detailed ways
为使本公开实施例的目的、技术方案和优点更加清楚,下面将结合本公开实施例中附图,对本公开实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本公开一部分实施例,而不是全部的实施例。通常在此处附图中描述和示出的本公开实施例的组件可以以各种不同的配置来布置和设计。因此,以下对在附图中提供的本公开的实施例的详细描述并非旨在限制要求保护的本公开的范围,而是仅仅表示本公开的选定实施例。基于本公开的实施例,本领域技术人员在没有做出创造性劳动的前提下所获得的所有其他实施例,都属于本公开保护的范围。In order to make the purposes, technical solutions and advantages of the embodiments of the present disclosure more clear, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present disclosure. Obviously, the described embodiments are only These are some, but not all, embodiments of the present disclosure. The components of the disclosed embodiments generally described and illustrated in the drawings herein may be arranged and designed in a variety of different configurations. Therefore, the following detailed description of the embodiments of the disclosure provided in the accompanying drawings is not intended to limit the scope of the disclosure as claimed, but is merely representative of selected embodiments of the disclosure. Based on the embodiments of the present disclosure, all other embodiments obtained by those skilled in the art without creative work fall within the protection scope of the present disclosure.
应注意到:相似的标号和字母在下面的附图中表示类似项,因此,一旦某一项在一个附图中被定 义,则在随后的附图中不需要对其进行进一步定义和解释。It should be noted that like numerals and letters refer to like items in the following figures, so once an item is defined in one figure, it does not require further definition and explanation in subsequent figures.
本文中术语“和/或”,仅仅是描述一种关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。另外,本文中术语“至少一种”表示多种中的任意一种或多种中的至少两种的任意组合,例如,包括A、B、C中的至少一种,可以表示包括从A、B和C构成的集合中选择的任意一个或多个元素。The term "and/or" in this paper only describes an association relationship, which means that there can be three kinds of relationships, for example, A and/or B, which can mean: the existence of A alone, the existence of A and B at the same time, the existence of B alone. a situation. In addition, the term "at least one" herein refers to any combination of any one of the plurality or at least two of the plurality, for example, including at least one of A, B, and C, and may mean including from A, B, and C. Any one or more elements selected from the set of B and C.
针对进行图像识别的神经网络的训练过程,需要借助于大量已经标注的图像样本才能进行,比如针对训练图像检测类的神经网络,需要借助于大量的携带有检测框标注信息才能完成训练过程;针对进行实例分割的神经网络训练过程,需要依赖于大量的携带有实例轮廓标注信息的图像样本才能实现。因此,为了训练得到精度较高的神经网络,需要大量的携带有标注信息的图像样本,而标注信息的标注过程需要人工手动标注,这意味着需要消耗大量时间对图像样本中的各个目标对象进行标注。因此,相关技术中的图像标注方式消耗时间久,且效率较低。The training process of a neural network for image recognition requires the help of a large number of labeled image samples. For example, for training a neural network for image detection, it needs to rely on a large amount of labeled information carrying the detection frame to complete the training process; for The neural network training process for instance segmentation needs to rely on a large number of image samples carrying instance outline annotation information. Therefore, in order to train a high-precision neural network, a large number of image samples with annotation information are required, and the annotation process of annotation information requires manual annotation, which means that it takes a lot of time to perform the image samples for each target object. callout. Therefore, the image labeling method in the related art consumes a long time and has low efficiency.
基于上述问题,本公开提供了一种图像标注方法,针对每个待标注的目标图像,能够对该目标图像进行分块处理,得到多个图像块,然后根据预先训练的用于进行编码的神经网络,确定每个图像块对应的编码信息,根据每个图像块对应的编码信息,以及少量的预先标注类别信息的标注图像块的编码信息,就能够确定多个图像块中每个图像块对应的类别信息,然后基于目标图像对应的标注方式以及各图像块对应的类别信息,就能够完成对目标图像的标注。也就是说,本公开实施例提供的图像标注方法,基于少量的标注类别的标注图像块即可完成对整张目标图像的标注,大大节省了标注时间,提高了标注效率。Based on the above problems, the present disclosure provides an image labeling method. For each target image to be labelled, the target image can be processed into blocks to obtain a plurality of image blocks, and then according to the pre-trained neural network for coding network to determine the encoding information corresponding to each image block, and according to the encoding information corresponding to each image block and a small amount of encoding information of the marked image blocks with pre-marked category information, the corresponding image block of each of the multiple image blocks can be determined. Then, based on the annotation method corresponding to the target image and the category information corresponding to each image block, the annotation of the target image can be completed. That is to say, with the image labeling method provided by the embodiments of the present disclosure, the labeling of the entire target image can be completed based on a small number of labeling image blocks of labeling categories, which greatly saves labeling time and improves labeling efficiency.
本公开实施例所提供的图像标注方法可以应用于电子设备,示例性的,该电子设备可以是具有一定计算能力的计算机设备;示例性的,该计算机设备可以包括:终端设备、服务器以及其它处理设备中的任一种;示例性的,终端设备可以为用户设备(User Equipment,UE)、移动设备、用户终端、终端、蜂窝电话、无绳电话、个人数字处理(Personal Digital Assistant,PDA)、手持设备、计算设备、车载设备、可穿戴设备等。The image labeling method provided by the embodiments of the present disclosure can be applied to electronic devices. Exemplarily, the electronic device may be a computer device with a certain computing capability. Exemplarily, the computer device may include: a terminal device, a server, and other processing devices. Any of the devices; for example, the terminal device may be a user equipment (User Equipment, UE), a mobile device, a user terminal, a terminal, a cellular phone, a cordless phone, a Personal Digital Assistant (PDA), a handheld devices, computing devices, in-vehicle devices, wearable devices, etc.
在本公开的一些实施例中,该图像标注方法可以通过处理器调用存储器中存储的计算机可读指令的方式来实现。In some embodiments of the present disclosure, the image annotation method may be implemented by a processor invoking computer-readable instructions stored in a memory.
图1为本公开实施例提供的一种图像标注方法的流程图,如图1所示,该方法可以包括步骤S101~S106:FIG. 1 is a flowchart of an image labeling method provided by an embodiment of the present disclosure. As shown in FIG. 1 , the method may include steps S101 to S106:
S101,获取待进行标注的目标图像。S101: Acquire a target image to be marked.
示例性地,目标图像可以为用于训练进行图像识别的神经网络的样本图像;示例性的,在训练进行行人检测的神经网络的情况下,目标图像可以为预先采集的大量包含行人的图像;示例性的,在训练进行肺部病灶识别的神经网络的情况下,目标图像可以为预先采集的肺部图像。Exemplarily, the target image may be a sample image used for training a neural network for image recognition; exemplarily, in the case of training a neural network for pedestrian detection, the target image may be a large number of pre-collected images containing pedestrians; Exemplarily, in the case of training a neural network for lung lesion identification, the target image may be a pre-acquired lung image.
S102,对目标图像进行分块,得到多个图像块。S102: Divide the target image into blocks to obtain multiple image blocks.
示例性地,可以按照设定的行数和列数,对目标图像进行分块,得到尺寸相同的多个图像块,或者可以预设尺寸,对目标图像进行分块,得到多个与预设尺寸相同的图像块,每个图像块包含的像素点相同。Exemplarily, the target image can be divided into blocks according to the set number of rows and columns to obtain multiple image blocks of the same size, or the target image can be divided into blocks with a preset size to obtain multiple image blocks with the preset size. Image blocks with the same size, each image block contains the same pixels.
S103,对多个图像块中的每一图像块进行编码处理,得到各图像块对应的编码信息。S103: Perform encoding processing on each image block in the plurality of image blocks to obtain encoding information corresponding to each image block.
示例性地,可以基于预先训练的用于进行编码的神经网络来对每一个图像块进行编码处理,预测该图像块对应的编码信息;示例性的,任意两个图像块对应的编码信息,可以用来表示任意两个图像块之间的图像特征的相似度和/或距离信息,如此,根据两个图像块的编码信息可以判断这两个图像块是否属于相同的类别。Exemplarily, each image block can be encoded based on a pre-trained neural network for encoding, and the encoding information corresponding to the image block can be predicted; exemplarily, the encoding information corresponding to any two image blocks can be It is used to represent the similarity and/or distance information of the image features between any two image blocks. In this way, it can be determined whether the two image blocks belong to the same category according to the coding information of the two image blocks.
示例性的,通过进行编码的神经网络对图像块进行编码处理,可以构建图像块的图像特征与编码空间的映射关系,两个图像块对应的编码信息在编码空间中的距离越相近,可以表示这两个图像块的图像特征大概率越相似,或者,可以表示图像特征相似的图像块各自对应的编码信息在编码空间中的距离比较接近。Exemplarily, the image block is encoded by the encoding neural network, and the mapping relationship between the image feature of the image block and the encoding space can be constructed. The closer the distance between the encoding information corresponding to the two image blocks in the encoding space, the The image features of the two image blocks are more likely to be similar, or it can indicate that the distances in the coding space of the respective coding information corresponding to the image blocks with similar image features are relatively close.
示例性地,图像块对应的图像特征,可以包括图像块的纹理特征、光谱特征、颜色特征等能够表 示图像内容的特征中的至少一种特征。Exemplarily, the image features corresponding to the image blocks may include at least one of the features that can represent the image content, such as texture features, spectral features, and color features of the image blocks.
S104,对编码处理后的多个图像块中的部分图像块进行类别标注,得到标注图像块。S104: Perform category labeling on some image blocks in the plurality of image blocks after encoding processing, to obtain labeled image blocks.
S105,基于各图像块对应的编码信息以及标注图像块的编码信息,确定各图像块对应的类别信息。S105 , based on the encoding information corresponding to each image block and the encoding information annotating the image block, determine the category information corresponding to each image block.
示例性地,针对不同使用场景中的目标图像,该目标图像包含的类别信息可以预先确定,比如针对进行病灶检测的肺部图像,类别信息可以包括良性类别和病灶类别;针对待进行行人检测的目标图像,该类别信息可以包含行人类别和非行人类别;针对待进行实例标注的目标图像,该目标图像中的类别信息可以为各个实例对应的类别;比如针对道路场景的目标图像,该目标图像包含的类别信息可以包含车辆类别、行人类别以及道路类别。Exemplarily, for target images in different usage scenarios, the category information contained in the target images may be predetermined. For example, for lung images for lesion detection, the category information may include benign categories and lesion categories; for pedestrians to be detected The target image, the category information can include pedestrian categories and non-pedestrian categories; for the target image to be labeled with instances, the category information in the target image can be the category corresponding to each instance; for example, for the target image of the road scene, the target image The included category information may include vehicle category, pedestrian category, and road category.
示例性地,针对目标图像包含的多个图像块,可以预先对多个图像块中的部分图像块进行类别标注,得到确定类别信息的标注图像块,从而可以基于每个图像块的编码信息来确定与标注图像块属于相同类别的图像块,相同类别的图像块的类别信息可以相同,按照这样的方式,就可以确定出目标图像包含的多个图像块中每个图像块对应的类别信息。Exemplarily, for multiple image blocks included in the target image, some image blocks in the multiple image blocks may be classified in advance to obtain annotated image blocks for determining category information, so that the encoding information of each image block can be used to determine the type of image block. It is determined that the image blocks belong to the same category as the labeled image blocks, and the category information of the image blocks of the same category can be the same. In this way, the category information corresponding to each image block in the multiple image blocks included in the target image can be determined.
示例性地,以目标图像为肺部图像为例,可以对该肺部图像对应的多个图像块中的部分图像块进行类别标注,比如标注若干对应类别信息为病灶类别的图像块,可以得到若干表示病灶类别的标注图像块;标注若干对应类别信息为良性类别的图像块,可以得到若干表示良性类别的标注图像块,然后可以基于该肺部图像包含的每个图像块对应的编码信息,确定出每个图像块的类别信息,即得到该肺部图像中对应类别信息为病灶类别的图像块,以及对应类别信息为良性类别的图像块。Exemplarily, taking the target image as a lung image as an example, some image blocks in the multiple image blocks corresponding to the lung image can be classified, for example, annotating a number of image blocks corresponding to the category information as the lesion category, we can obtain: A number of annotated image blocks representing the lesion category; annotating a number of image blocks with corresponding category information as benign categories, several labeled image blocks representing benign categories can be obtained, and then based on the encoding information corresponding to each image block contained in the lung image, The category information of each image block is determined, that is, image blocks whose corresponding category information is a lesion category and an image block whose corresponding category information is a benign category are obtained in the lung image.
S106,基于目标图像对应的标注方式以及各图像块对应的类别信息,对目标图像进行标注。S106 , label the target image based on the labeling manner corresponding to the target image and the category information corresponding to each image block.
示例性地,标注方式可以是预先根据目标图像的使用场景来确定的,比如针对需要标注出目标图像中目标对象的矩形框的情况,该标注方式可以为进行矩形框标注的方式;针对需要标注出目标图像中目标对象的轮廓的情况,该标注方式可以为进行轮廓标注的方式;针对需要标注出目标图像的类别的情况,该标注方式可以为进行分类标注的方式。Exemplarily, the labeling method may be determined in advance according to the use scene of the target image. For example, in the case where a rectangular frame of the target object in the target image needs to be marked, the labeling method may be a method of labeling a rectangular frame; In the case of identifying the contour of the target object in the target image, the labeling method may be the method of contour labeling; for the case where the category of the target image needs to be marked, the labeling method may be the method of classifying and labeling.
根据上述方式确定出目标图像包含的每个图像块对应的类别信息后,可以按照该目标图像对应标注方式对该目标图像进行标注。After the category information corresponding to each image block included in the target image is determined according to the above method, the target image can be labeled according to the corresponding labeling method of the target image.
本公开实施例提供的图像标注方法中,针对每个待标注的目标图像,可以对该目标图像进行分块处理,得到多个图像块,并确定每个图像块对应的编码信息,进一步根据每个图像块对应的编码信息,以及少量的预先标注类别的标注图像块的编码信息,就能够确定多个图像块中每个图像块对应的类别信息,进一步基于目标图像对应的标注方式和各图像块对应的类别信息完成对目标图像的标注。也就是说,本公开实施例提供的图像标注方法实现过程中,基于少量的标注类别信息的标注图像块即可以完成对整张目标图像的标注,从而大大节省了标注时间,提高了标注效率。示例性地,通过使用本公开实施例提供的图像标注方法,能够在医疗领域中快速标注出病人器官图像中的病灶区域,从而能够高效辅助临床诊断。In the image labeling method provided by the embodiment of the present disclosure, for each target image to be labelled, the target image may be processed into blocks to obtain a plurality of image blocks, and the encoding information corresponding to each image block is determined, and further according to each image block The coding information corresponding to each image block and a small number of coding information of pre-annotated category-marked image blocks can determine the category information corresponding to each image block in the multiple image blocks, and further based on the corresponding marking method of the target image and each image block. The category information corresponding to the block completes the annotation of the target image. That is to say, in the implementation process of the image labeling method provided by the embodiments of the present disclosure, the labeling of the entire target image can be completed based on a small amount of labelled image blocks of labeling category information, thereby greatly saving labeling time and improving labeling efficiency. Exemplarily, by using the image labeling method provided by the embodiments of the present disclosure, the lesion area in the patient's organ image can be quickly labelled in the medical field, so that clinical diagnosis can be efficiently aided.
下面将结合具体实施例对上述S101~S106进行阐述。The foregoing S101 to S106 will be described below with reference to specific embodiments.
在本公开实施例中,对多个图像块中的每一图像块进行编码处理,得到各图像块对应的编码信息,可以通过如图2所示的S1031~S1032实现:In this embodiment of the present disclosure, encoding processing is performed on each image block in the plurality of image blocks to obtain encoding information corresponding to each image block, which may be implemented through S1031 to S1032 as shown in FIG. 2 :
S1031,将各图像块输入神经网络,通过神经网络提取各图像块包含的图像特征;S1031, input each image block into a neural network, and extract image features contained in each image block through the neural network;
S1032,通过神经网络,基于各图像块的图像特征确定各图像块对应的编码信息。S1032 , through a neural network, determine the coding information corresponding to each image block based on the image feature of each image block.
预先训练的用于进行编码的神经网络在接收到图像块后,可以提取该图像块包含的图像内容,比如可以通过图像特征来表示该图像块的图像内容,若预先训练的用于进行编码的神经网络可以构建图像块的图像特征与编码空间的映射关系,那么,在提取到图像块的图像特征后,就可以按照预先训练的映射关系,得到该图像特征对应的编码信息,从而得到该图像块对应的编码信息。After receiving the image block, the pre-trained neural network for encoding can extract the image content contained in the image block. For example, the image content of the image block can be represented by image features. The neural network can construct the mapping relationship between the image feature of the image block and the encoding space. Then, after extracting the image feature of the image block, the encoding information corresponding to the image feature can be obtained according to the pre-trained mapping relationship, so as to obtain the image. The encoding information corresponding to the block.
本公开实施例中,通过预先训练的用于进行编码的神经网络对图像块进行处理,就可以提前建立图像特征与编码信息之间的映射关系,从而在提取到图像块的图像特征后,可以快速确定该图像块对应的编码信息。In the embodiment of the present disclosure, the image block is processed by the pre-trained neural network for encoding, so that the mapping relationship between the image features and the encoding information can be established in advance, so that after the image features of the image block are extracted, the image block can be processed. Quickly determine the encoding information corresponding to the image block.
在本公开实施例中,预先训练的用于进行编码的神经网络,可以是通过如图3所示的S301~S304 实现的:In this embodiment of the present disclosure, the pre-trained neural network for encoding may be implemented through S301 to S304 as shown in FIG. 3 :
S301,获取多个样本图像,并对每个样本图像进行分块,得到多个样本图像块以及每个样本图像块的位置信息。S301: Acquire multiple sample images, and divide each sample image into blocks to obtain multiple sample image blocks and position information of each sample image block.
对多个样本图像进行分块得到多个样本图像块的过程与上文得到目标图像包含的多个图像块的方式相同,在此不进行赘述。The process of segmenting multiple sample images to obtain multiple sample image blocks is the same as the above-mentioned method of obtaining multiple image blocks included in the target image, and will not be repeated here.
示例性地,每个样本图像块的位置信息,可以通过该样本图像块的中心点在样本图像对应的图像坐标系中的位置坐标进行表示。Exemplarily, the position information of each sample image block may be represented by the position coordinates of the center point of the sample image block in the image coordinate system corresponding to the sample image.
S302,基于每个样本图像块的位置信息,确定第一样本图像块对以及第二样本图像块对。S302, based on the position information of each sample image block, determine a first sample image block pair and a second sample image block pair.
其中,第一样本图像块对中的两个样本图像块之间的距离小于或等于设定阈值;第二样本图像块对中的两个样本图像块之间的距离大于设定阈值。Wherein, the distance between the two sample image blocks in the first sample image block pair is less than or equal to the set threshold; the distance between the two sample image blocks in the second sample image block pair is greater than the set threshold.
示例性的,在样本图像中,空间位置上接近的样本图像块之间的图像特征比较相似,属于相同类别信息的概率较大;空间位置上相距较远的样本图像块之间的图像特征可能不相似,属于相同类别信息的概率较小,因此可以基于样本图像块之间的距离信息来构建第一样本图像块对以及第二样本图像块对,比如,可以根据距离信息,将属于同一帧样本图像且距离小于或等于设定阈值的两个图像块作为第一样本图像对,将属于同一帧样本图像且距离大于设定阈值的两个图像块,或者属于不同帧样本图像中的两个样本图像块作为第二样本图像对。Exemplarily, in a sample image, the image features between sample image blocks that are close to each other in space are relatively similar, and the probability of belonging to the same category of information is high; the image features between sample image blocks that are far apart in space may be are not similar, the probability of belonging to the same category of information is small, so the first sample image block pair and the second sample image block pair can be constructed based on the distance information between the sample image blocks. The two image blocks of the frame sample image and the distance less than or equal to the set threshold are taken as the first sample image pair, and the two image blocks belonging to the same frame sample image and the distance greater than the set threshold, or the two image blocks belonging to different frame sample images. The two sample image patches serve as the second sample image pair.
S303,分别将第一样本图像块对以及第二样本图像块对输入待训练的神经网络,得到每个样本图像块对应的预测编码信息。S303, respectively inputting the first sample image block pair and the second sample image block pair into the neural network to be trained, to obtain predictive coding information corresponding to each sample image block.
示例性地,将第一样本图像块对中包含的两个样本图像块输入待训练的神经网络后,可以分别获取到这两个样本图像块的图像特征,并基于这两个样本图像块分别对应的图像特征,对这两个样本图像块进行压缩编码,就可以得到这两个样本图像块对应的预测编码信息。Exemplarily, after inputting the two sample image blocks included in the first sample image block pair into the neural network to be trained, the image features of the two sample image blocks can be obtained respectively, and based on the two sample image blocks By compressing and encoding the two sample image blocks corresponding to the corresponding image features respectively, prediction coding information corresponding to the two sample image blocks can be obtained.
S304,基于每个样本图像块对应的预测编码信息,对待训练的神经网络的网络参数进行调整,得到训练完成的用于进行编码的神经网络。S304, based on the predictive coding information corresponding to each sample image block, adjust the network parameters of the neural network to be trained to obtain a trained neural network for coding.
示例性的,在对网络参数的调整过程中,可以通过引入无监督聚类算法来训练用于进行编码的神经网络;示例性的,在训练过程中,通过调整网络参数,可以使得第一样本图像块对包含的两个样本图像块对应的预测编码信息之间的距离逐渐缩小,使得第二样本图像块对包含的两个样本图像块对应的预测编码信息之间的距离逐渐放大;在调整第一样本图像块或者第二样本图像块包含的两个样本图像块对应的预测编码信息时,可以同时对每个图像块对应的图像特征进行调整;示例性的,在调整达到设定训练次数,或者损失函数对应的损失值小于设定损失值后,得到的图像特征和编码空间的映射关系,可以表示相似图像块对应的编码信息在编码空间中的距离较近,不相似图像块对应的编码信息在编码空间中的距离较远,此时就可以得到训练完成的用于进行编码的神经网络。Exemplarily, in the process of adjusting the network parameters, an unsupervised clustering algorithm can be introduced to train the neural network for encoding; Exemplarily, in the process of training, by adjusting the network parameters, the first The distance between the predictive coding information corresponding to the two sample image blocks included in this image block pair is gradually reduced, so that the distance between the predictive coding information corresponding to the two sample image blocks included in the second sample image block pair is gradually enlarged; When adjusting the predictive coding information corresponding to the two sample image blocks included in the first sample image block or the second sample image block, the image features corresponding to each image block can be adjusted at the same time; After the number of training times, or the loss value corresponding to the loss function is less than the set loss value, the obtained mapping relationship between image features and encoding space can indicate that the encoding information corresponding to similar image blocks is closer in the encoding space, and dissimilar image blocks are closer in the encoding space. The corresponding encoded information is far away in the encoding space, and at this time, the trained neural network for encoding can be obtained.
示例性地,编码信息可以通过向量来表示,两个图像块对应的编码信息之间的距离可以通过余弦距离公式确定。Exemplarily, the encoded information may be represented by a vector, and the distance between the encoded information corresponding to two image blocks may be determined by a cosine distance formula.
本公开实施例中,在训练用于进行编码的神经网络的过程中,通过引入相互距离小于或等于设定阈值的第一样本图像块对以及相互距离大于设定阈值的第二样本图像块对,对该神经网络进行训练,在训练过程中,通过基于空间上距离较近的样本图像块之间的图像特征的相似度较高的训练准则对网络参数进行调整,就能够准确得到用于基于图像块确定该图像块对应的编码信息的神经网络。In the embodiment of the present disclosure, in the process of training a neural network for encoding, a pair of first sample image blocks whose mutual distance is less than or equal to a set threshold and a second sample image block whose mutual distance is greater than the set threshold are introduced. Yes, the neural network is trained. In the training process, the network parameters can be accurately obtained by adjusting the network parameters based on the training criteria with high similarity of image features between the sample image blocks that are close in space. A neural network that determines the encoded information corresponding to the image block based on the image block.
在本公开实施例中,可以通过引入半监督学习算法来确定每个图像块对应的类别信息,示例性地,通过给定的标注图像块的类别信息、编码信息以及编码空间分布信息,来得到目标图像包含的多个图像块中每个图像块对应的类别信息。In the embodiment of the present disclosure, the category information corresponding to each image block can be determined by introducing a semi-supervised learning algorithm, and exemplarily, the category information, encoding information, and encoding space distribution information of a given labeled image block can be obtained. Category information corresponding to each image block in the multiple image blocks contained in the target image.
示例性地,基于编码空间分布信息,能够反映出目标图像包含的多个图像块分别对应的编码信息在编码空间中的位置分布情况,两个图像块之间的图像特征的相似度越高,这两个图像块对应的编码信息在编码空间中对应的距离越大概率接近;或者,编码空间分布可以为基于多个图像块对应的编码信息进行聚类处理之后得到的聚类分布,这样,在目标图像包含多种类别的目标对象时,该目标图像对应的编码空间分布可以包含多个聚类簇,每个聚类簇包含的图像块属于相同类别信息的概率较大, 基于此,在确定其中一个聚类簇包含的编码信息对应的类别信息后,可以确定该聚类簇包含的其它编码信息对应的类别信息,即可以得到目标图像包含的多个图像块中每个图像块对应的类别信息。Exemplarily, based on the coding space distribution information, it is possible to reflect the position distribution in the coding space of the coding information corresponding to the multiple image blocks included in the target image, and the higher the similarity of the image features between the two image blocks, The larger the corresponding distance in the coding space, the coding information corresponding to the two image blocks has a probability of being close; or, the coding space distribution can be a clustering distribution obtained after clustering processing based on the coding information corresponding to multiple image blocks, so that, When the target image contains target objects of various categories, the coding space distribution corresponding to the target image may contain multiple clusters, and the image blocks contained in each cluster have a high probability of belonging to the same category of information. After determining the category information corresponding to the encoding information contained in one of the clusters, the category information corresponding to other encoding information contained in the cluster can be determined, that is, the corresponding category information of each image block in the multiple image blocks contained in the target image can be obtained. Category information.
在本公开实施例中,基于目标图像对应的标注方式以及各图像块对应的类别信息,对目标图像进行标注,可以通过如图4所示的S1061~S1062实现:In this embodiment of the present disclosure, marking the target image based on the labeling method corresponding to the target image and the category information corresponding to each image block can be implemented through S1061 to S1062 as shown in FIG. 4 :
S1061,在标注方式为进行矩形框标注的情况下,获取对应类别信息相同的图像块;S1061, when the labeling method is to label a rectangular frame, obtain image blocks with the same corresponding category information;
S1062,按照对应类别信息相同的图像块的最小外围矩形框对目标图像进行标注。S1062: Mark the target image according to the minimum peripheral rectangular frame of the image blocks corresponding to the same category information.
示例性地,对应类别信息相同的图像块可以包括多个,在对目标图像进行标注时,可以按照单连通域搜索的方式,对类别信息相同的图像块进行搜索,得到与类别信息相同的图像块对应的最小外围矩形框,然后按照该最小外围矩形框进行标注。Exemplarily, a plurality of image blocks with the same category information may be included. When annotating the target image, the image blocks with the same category information may be searched in the manner of a single-connected domain search to obtain an image with the same category information. The minimum surrounding rectangle corresponding to the block is then marked according to the minimum surrounding rectangle.
示例性地,在目标图像为肺部图像的情况下,按照上述方式,可以对肺部图像中的类别信息为病灶的图像块进行标注,得到肺部图像中的病灶区域。Exemplarily, in the case where the target image is a lung image, in the above manner, an image block in the lung image whose category information is a lesion can be marked to obtain a lesion area in the lung image.
本公开实施例中,通过识别出的目标图像包含的各图像块对应的类别信息,可以完成对目标图像中包含的类别信息相同的图像块的标注,示例性地,可以标注出目标图像中包含的各个目标对象的矩形框,该过程无需用户进行手工标注,从而能够大大节省标注时间,提高标注效率。In the embodiment of the present disclosure, by using the category information corresponding to each image block included in the identified target image, the labeling of the image blocks with the same category information included in the target image can be completed. This process does not require the user to manually mark the rectangle frame of each target object, which can greatly save the marking time and improve the marking efficiency.
在本公开实施例中,基于目标图像对应的标注方式以及各图像块对应的类别信息,对目标图像进行标注,可以通过如图5所示的S1063~S1066实现:In this embodiment of the present disclosure, marking the target image based on the labeling method corresponding to the target image and the category information corresponding to each image block can be implemented through S1063 to S1066 as shown in FIG. 5 :
S1063,在标注方式为进行轮廓标注的情况下,基于各图像块对应的类别信息以及各图像块包含的像素点,确定目标图像中各个像素点对应的类别信息。S1063 , when the labeling method is contour labeling, determine the class information corresponding to each pixel in the target image based on the class information corresponding to each image block and the pixels included in each image block.
示例性地,在标注方式为进行轮廓标注的情况下,为了提高标注的准确度,可以确定出目标图像包含的各个像素点对应的类别信息。Exemplarily, when the labeling method is to perform contour labeling, in order to improve the labeling accuracy, category information corresponding to each pixel included in the target image may be determined.
示例性地,在图像块分割的尺寸较小时,可以将图像块的类别信息作为该图像块包含的各个像素点对应的类别信息,比如一图像块对应的类别信息为病灶类别,则该图像块包含的所有像素点对应的类别信息可以均为病灶类别;示例性的,当图像块为目标对象边缘的图像块时,该图像块中包含的像素点的类别信息可以不同。Exemplarily, when the size of the image block segmentation is small, the category information of the image block can be used as the category information corresponding to each pixel included in the image block. For example, the category information corresponding to an image block is a lesion category, then the image block The category information corresponding to all the included pixels may be lesion categories; for example, when the image block is an image block at the edge of the target object, the category information of the pixels included in the image block may be different.
示例性的,在将图像块对应的类别信息作为该图像块包含的各个像素点对应的类别信息时,为了提高像素点的类别信息的准确度,对一些像素点的类别信息,尤其是目标对象边缘的像素点对应的类别信息需要进一步调整,详见后文描述。Exemplarily, when the category information corresponding to the image block is used as the category information corresponding to each pixel included in the image block, in order to improve the accuracy of the category information of the pixel, the category information of some pixels, especially the target object The category information corresponding to the edge pixels needs to be further adjusted, as described later.
S1064,获取目标图像中各个像素点的属性特征,并基于各个像素点对应的类别信息以及属性特征,确定目标像素点。S1064: Acquire attribute features of each pixel in the target image, and determine the target pixel based on category information and attribute features corresponding to each pixel.
其中,目标像素点为待进行类别信息调整的像素点。The target pixel is the pixel to be adjusted for category information.
示例性地,在确定是否存在待进行类别信息调整的目标像素点的过程中,可以引入条件随机场模型,通过条件随机场模型来确定是否存在待进行类别信息调整的目标像素点,并对待进行类别信息调整的目标像素点的类别信息进行调整。Exemplarily, in the process of determining whether there is a target pixel to be adjusted for category information, a conditional random field model may be introduced, and the conditional random field model is used to determine whether there is a target pixel to be adjusted for category information, and to be adjusted. The category information of the target pixel for category information adjustment is adjusted.
示例性的,可以提取目标图像包含的各个像素点的属性特征,不同像素点之间的属性特征可以用于表示这些像素点之间的差异信息,比如可以包含纹理差异、梯度差异、灰度值差异等差异信息,由于对应类别信息不准确的像素点大概率情况下为目标图像中目标对象边缘的像素点,因此可以基于各个像素点对应的属性特征来筛选出目标图像中目标对象边缘的像素点。Exemplarily, the attribute features of each pixel included in the target image can be extracted, and the attribute features between different pixels can be used to represent the difference information between these pixels, such as texture differences, gradient differences, grayscale values. Difference information such as difference, because the pixels with inaccurate category information are likely to be pixels on the edge of the target object in the target image, so the pixels on the edge of the target object in the target image can be filtered out based on the attribute features corresponding to each pixel. point.
示例性的,属性特征相同的两个像素点对应的类别信息大概率一致,若存在与目标对象边缘的某个像素点的属性特征相同、但是对应的类别信息不一致的像素点,可以考虑该像素点为待进行类别信息调整的目标像素点。Exemplarily, the category information corresponding to two pixels with the same attribute feature is likely to be consistent. If there is a pixel with the same attribute feature as a certain pixel on the edge of the target object, but the corresponding category information is inconsistent, the pixel can be considered. The point is the target pixel to be adjusted for category information.
S1065,在存在目标像素点的情况下,基于与目标像素点对应属性特征相同的像素点的类别信息,对目标像素点对应的类别信息进行调整,得到目标图像中各个像素点对应的目标类别信息。S1065 , in the case that the target pixel exists, adjust the category information corresponding to the target pixel based on the category information of the pixel with the same attribute feature as the target pixel to obtain the target category information corresponding to each pixel in the target image .
示例性的,由于属性特征相同的两个像素点对应的类别信息大概率一致,因此可以基于与该目标像素点的属性特征相同的其它像素点的类别信息,对该目标像素点的类别信息进行调整,并在对目标像素点对应的类别信息进行调整后,得到目标图像中各个像素点对应的目标类别信息。Exemplarily, since the category information corresponding to two pixels with the same attribute feature is highly likely to be the same, the category information of the target pixel can be analyzed based on the category information of other pixels with the same attribute feature as the target pixel. After adjusting the category information corresponding to the target pixel point, the target category information corresponding to each pixel point in the target image is obtained.
S1066,基于目标图像中各个像素点对应的目标类别信息,对属于同一目标类别的像素点构成的目标对象的轮廓进行标注。S1066, based on the target category information corresponding to each pixel in the target image, annotate the contour of the target object formed by the pixels belonging to the same target category.
示例性地,可以通过目标图像中各个像素点对应的目标类别信息,对属于相同类别信息的像素点构成的区域的轮廓进行标注,这样可以完成对目标图像中包含的目标对象的轮廓标注。Exemplarily, the contour of the region formed by pixels belonging to the same category information can be annotated through the target category information corresponding to each pixel in the target image, so that the contour annotation of the target object contained in the target image can be completed.
示例性的,在上述步骤S1064之后,在确定不存在目标像素点的情况下,基于目标图像中各个像素点对应的类别信息,对属于同一目标类别的像素点构成的目标对象的轮廓进行标注。Exemplarily, after the above step S1064, if it is determined that there is no target pixel, based on the category information corresponding to each pixel in the target image, the outline of the target object formed by pixels belonging to the same target category is marked.
该情况可以表示针对目标对象边缘的像素点的类别信息的预测较为准确,不需要再对其进行调整,该情况对应的针对目标对象的标注过程与上文介绍的相似,在此不再进行赘述。This situation can indicate that the prediction of the category information of the pixel points on the edge of the target object is relatively accurate, and there is no need to adjust it. The corresponding labeling process for the target object in this situation is similar to that described above, and will not be repeated here. .
本公开实施例中,在确定存在类别信息不准确的目标像素点时,能够基于目标图像包含的各个像素点对应的类别信息以及属性特征,准确地确定出各个像素点对应的目标类别信息,从而得到准确度较高的分割标注结果。In the embodiment of the present disclosure, when it is determined that there are target pixels with inaccurate category information, the target category information corresponding to each pixel can be accurately determined based on the category information and attribute features corresponding to each pixel included in the target image, thereby The segmentation and annotation results with higher accuracy are obtained.
示例性的,针对S1064,在基于各个像素点对应的类别信息以及属性特征,确定目标像素点时,可以通过S10641~S10643实现:Exemplarily, for S1064, when the target pixel is determined based on the category information and attribute features corresponding to each pixel, S10641 to S10643 may be used to implement:
S10641,选择各个像素点中的至少一个作为第一像素点;基于第一像素点的属性特征,确定第一像素点与第二像素点的属性特征的差异值。S10641: Select at least one of each pixel point as the first pixel point; based on the attribute feature of the first pixel point, determine the difference value of the attribute feature of the first pixel point and the second pixel point.
其中,第二像素点与第一像素点相邻。Wherein, the second pixel is adjacent to the first pixel.
示例性地,第一像素点和第二像素点是指在目标图像像素坐标相邻的像素点。Exemplarily, the first pixel point and the second pixel point refer to the pixel points adjacent to the pixel coordinates of the target image.
示例性地,可以通过上文提到的条件随机场模型,确定出每个第一像素点与第二像素点的属性特征的差异值。Exemplarily, the difference value of the attribute feature of each first pixel point and the second pixel point can be determined through the conditional random field model mentioned above.
示例性的,本公开实施例提出的各个像素点的类别信息的确定方式中,可以对作为目标对象边缘的一些像素点的类别信息进行调整,在调整过程中可以基于相邻像素点之间的属性特征的差异值是否大于预设阈值确定目标对象边缘的像素点;示例性的,预设阈值可以为预先设好的,也可以为在基于条件随机场模型确定目标对象边缘的像素点时确定的。Exemplarily, in the method for determining the category information of each pixel point proposed in the embodiment of the present disclosure, the category information of some pixel points serving as the edge of the target object may be adjusted, and the adjustment process may be based on the difference between adjacent pixel points. Whether the difference value of the attribute feature is greater than a preset threshold determines the pixel points on the edge of the target object; exemplarily, the preset threshold value can be preset, or can be determined when the pixel points on the edge of the target object are determined based on the conditional random field model of.
示例性地,为了提高像素点的类别信息的准确度,可以确定每个像素点与至少一个相邻的像素点的属性特征的差异值是否大于预设阈值,如此就可以找到较多的需要进行调整的目标像素点,当然为了提高标注效率,也可以设定与该像素点待进行属性特征比较的相邻像素点的个数,本公开实施例对此不进行限定。Exemplarily, in order to improve the accuracy of the category information of the pixel, it can be determined whether the difference value of the attribute feature of each pixel and at least one adjacent pixel is greater than a preset threshold, so that more needs to be carried out can be found. Of course, for the adjusted target pixel, in order to improve the labeling efficiency, the number of adjacent pixels to be compared with the pixel to be compared with the attributes may also be set, which is not limited in this embodiment of the present disclosure.
S10642,在差异值大于预设阈值的情况下,选择至少一个第三像素点。S10642, in the case that the difference value is greater than the preset threshold, select at least one third pixel point.
其中,第三像素点为具有与第一像素点相同的属性特征的像素点。Wherein, the third pixel point is a pixel point having the same attribute characteristics as the first pixel point.
示例性地,在确定第一像素点与相邻的第二像素点的属性特征的差异值大于预设阈值的情况下,可以将该第一像素点可以作为待进行类别信息调整的候选像素点,这些候选像素点大概率为目标对象边缘的像素点。Exemplarily, when it is determined that the difference value of the attribute feature of the first pixel point and the adjacent second pixel point is greater than a preset threshold, the first pixel point can be used as a candidate pixel point to be adjusted for category information. , these candidate pixels are likely to be pixels on the edge of the target object.
基于前文的说明可知,属性特征相同的像素点对应的类别信息一致,因此,在确定第一像素点与相邻的第二像素点的属性特征的差异值大于预设阈值的情况下,可以进一步判断第一像素点对应的类别信息、以及与该像素点的属性特征相同的第三像素点的类别信息是否相同。Based on the foregoing description, it can be seen that the category information corresponding to the pixels with the same attribute features is consistent. Therefore, in the case where it is determined that the difference value of the attribute features of the first pixel point and the adjacent second pixel point is greater than the preset threshold, it is possible to further It is judged whether the category information corresponding to the first pixel point and the category information of the third pixel point having the same attribute feature as the pixel point are the same.
S10643,在第一像素点对应的类别信息与第三像素点对应的类别信息不一致的情况下,将第一像素点作为目标像素点。S10643: In the case that the category information corresponding to the first pixel point is inconsistent with the category information corresponding to the third pixel point, the first pixel point is used as the target pixel point.
示例性地,确定出第一像素点A对应的类别信息为病灶类别,且与第一像素点A的属性特征相同的其它若干第三像素点的类别信息均为良性类别,则第一像素点A的类别信息良性类别的概率较大,因此可以将第一像素点A作为待进行类别信息调整的目标像素点。Exemplarily, it is determined that the category information corresponding to the first pixel point A is the lesion category, and the category information of several other third pixel points that have the same attribute characteristics as the first pixel point A are benign categories, then the first pixel point The category information of A has a relatively high probability of being a benign category, so the first pixel point A can be used as the target pixel point to be adjusted for category information.
本公开实施例中,通过相邻像素点之间的属性特征以及类别信息,可以快速确定出待进行类别信息调整的目标像素点,比如如果一个像素点与相邻像素点的属性特征的差异值较大,且该像素点与与其属性特征相同的其它像素点的类别信息不相同,那么,就可以大概率确定出该像素点的类别信息有误,因此按照该方式可以快速确定出待进行类别信息调整的目标像素点。In the embodiment of the present disclosure, the target pixel to be adjusted for the category information can be quickly determined through the attribute features and category information between adjacent pixels. is larger, and the category information of the pixel is different from that of other pixels with the same attribute characteristics, then it can be determined that the category information of the pixel is wrong with a high probability, so the category to be processed can be quickly determined in this way. The target pixel for information adjustment.
针对上述S106,在本公开实施例中,基于目标图像对应的标注方式和各图像块对应的类别信息, 对目标图像进行标注,可以通过如图6所示的S1067~S1068实现:For the above S106, in this embodiment of the present disclosure, marking the target image based on the labeling method corresponding to the target image and the category information corresponding to each image block can be implemented through S1067-S1068 as shown in FIG. 6 :
S1067,在标注方式为进行分类标注的情况下,基于各图像块对应的类别信息,确定每种类别信息对应的图像块个数。S1067 , when the labeling method is to perform classification labeling, determine the number of image blocks corresponding to each type of information based on the class information corresponding to each image block.
S1068,基于每种类别信息对应的图像块个数,确定目标图像的类别信息。S1068: Determine the category information of the target image based on the number of image blocks corresponding to each category of information.
示例性地,在需要确定整张目标图像的类别信息的情况下,需要分类统计目标图像包含的对应每种类别信息的图像块个数,然后可以将包含最多图像块个数的图像块的类别信息作为该目标图像的类别信息。Exemplarily, in the case where the category information of the entire target image needs to be determined, the number of image blocks corresponding to each category of information contained in the target image needs to be classified and counted, and then the category of the image block containing the maximum number of image blocks can be classified. information as the category information of the target image.
示例性地,为了提高确定的目标图像的类别信息的准确度,除了确定每种类别信息对应的图像块个数,还可以增加设定个数阈值条件,比如满足任一类别信息的图像块个数达到设定个数阈值、且该对应该任一类别信息的图像块个数最多的条件下,可以将该任一类别信息作为目标图像的类别信息。Exemplarily, in order to improve the accuracy of the determined category information of the target image, in addition to determining the number of image blocks corresponding to each category of information, a threshold condition for setting the number can also be added, such as the number of image blocks satisfying any category information. Under the condition that the number reaches the set number threshold and the number of image blocks corresponding to any category information is the largest, any category information can be used as category information of the target image.
本公开实施例中,通过确定目标图像包含的每种类别信息对应的图像块个数,可以快速确定该目标图像的类别信息。In the embodiment of the present disclosure, by determining the number of image blocks corresponding to each category of information contained in the target image, the category information of the target image can be quickly determined.
本公开实施例提供的图像标注方法还可以包括以下操作:The image labeling method provided by the embodiment of the present disclosure may further include the following operations:
对目标图像进行标注后,响应于针对目标图像块的标注类别更新指示,对标注图像块的类别信息进行更新;返回执行上述S105的步骤,即基于各图像块对应的编码信息以及标注图像块的编码信息,确定各图像块对应的类别信息的步骤。After the target image is annotated, the category information of the annotated image block is updated in response to the annotation category update instruction for the target image block; the step of performing the above-mentioned S105 is returned, that is, based on the coding information corresponding to each image block and the information of the annotated image block. The step of encoding information and determining the category information corresponding to each image block.
示例性地,对标注图像块的类别信息进行更新可以包含以下几种情况:Exemplarily, updating the category information of annotated image blocks may include the following situations:
(1)对已经预先标注类别信息的标注图像块的类别信息进行更改,比如将病灶类别改为良性类别;(1) Change the category information of annotated image blocks that have been pre-annotated with category information, such as changing the lesion category to benign category;
(2)新增标注图像块,比如针对未标注类别信息的图像块进行标注类别;(2) Newly labeled image blocks, such as labeling categories for image blocks without category information;
(3)对已经预先标注类别信息的标注图像块的类别信息进行更改,以及新增标注图像块。(3) Modify the category information of the labeled image blocks that have been pre-labeled with category information, and add new labeled image blocks.
示例性地,针对上述情况(1),在对目标图像进行标注后,可以对标注结果进行微调,以获得更加准确地标注结果,比如可以对局部图像块的类别信息进行更改,然后返回执行上述步骤S105的步骤,从而能够获取各个图像块对应的更加准确的类别信息,这样可以基于更加准确的类别信息对目标图像进行标注。Exemplarily, for the above situation (1), after the target image is annotated, the annotation results can be fine-tuned to obtain more accurate annotation results. In step S105, more accurate category information corresponding to each image block can be obtained, so that the target image can be marked based on the more accurate category information.
示例性地,针对上述情况(2),目标图像中包含多个目标对象,而初始的标注类别信息仅包括对其中一个目标对象包含的图像块进行了标注,则按照这样的方式得到的目标图像的标注结果中仅包含针对该目标对象的类别信息,即标注结果并不完整,此时可以新增其它目标对象对应的标注图像块,然后返回执行上述步骤S105的步骤,从而能够获取更加完整的图像块的类别信息,这样可以得到目标图像对应的更加完整的标注结果。Exemplarily, for the above situation (2), the target image contains multiple target objects, and the initial labeling category information only includes labeling the image block included in one of the target objects, then the target image obtained in this way The labeling result only contains the category information for the target object, that is, the labeling result is not complete. At this time, the labeling image blocks corresponding to other target objects can be added, and then return to the above step S105, so that a more complete picture can be obtained. The category information of the image block, so that a more complete annotation result corresponding to the target image can be obtained.
示例性地,针对上述情况(3),具体方式为上述两种方式的结果,该方式可以同时提高目标图像标注的准确度和完整性。Exemplarily, for the above situation (3), the specific method is the result of the above two methods, and this method can improve the accuracy and completeness of the target image annotation at the same time.
本公开实施例中,可以基于目标图像的标注结果对标注图像块的类别信息进行更新,从而提高目标图像标注结果的准确度和/或完整性。In the embodiment of the present disclosure, the category information of the annotated image block may be updated based on the annotation result of the target image, thereby improving the accuracy and/or completeness of the annotation result of the target image.
本公开实施例中,在对目标图像进行标注后,可以基于标注结果重新调整图像块对应的类别信息,从而得到更加准确的标注结果。In the embodiment of the present disclosure, after the target image is marked, the category information corresponding to the image block can be readjusted based on the marking result, so as to obtain a more accurate marking result.
下面以一种具体实施例对本公开提供的图像标注结果进行说明:The image annotation results provided by the present disclosure will be described below with a specific embodiment:
如图7a所示,该目标图像为一张病人的肺部图像,对该肺部图像进行分块,可以得到多个肺部图像块(图7a中未示出),图7b中的深色矩形区域为手工标注类别的标注图像块所对应的类别信息,比如标注图像块对应的类别信息为病灶类别,然后按照上述提到的图像标注方式,可以确定出与标注图像块属于相同类别的所有图像块,进一步基于肺部图像中各个图像块对应的类别信息,对该肺部图像进行标注,可以得到针对目标对象的标注结果,比如得到如图7c所示的标注结果,该标注结果为病灶区域的轮廓图。As shown in Fig. 7a, the target image is a lung image of a patient, and the lung image is divided into blocks to obtain multiple lung image blocks (not shown in Fig. 7a), the dark color in Fig. 7b The rectangular area is the category information corresponding to the labeled image blocks of the manually labeled category. For example, the category information corresponding to the labeled image block is the lesion category. Then, according to the above-mentioned image annotation method, it can be determined that the labeled image block belongs to the same category. Image block, and further label the lung image based on the category information corresponding to each image block in the lung image, and the labeling result for the target object can be obtained, for example, the labeling result shown in Figure 7c is obtained, and the labeling result is a lesion Outline map of the area.
本领域技术人员可以理解,在具体实施方式的上述方法中,各步骤的撰写顺序并不意味着严格的执行顺序而对实施过程构成任何限定,各步骤的具体执行顺序应当以其功能和可能的内在逻辑确定。Those skilled in the art can understand that in the above method of the specific implementation, the writing order of each step does not mean a strict execution order but constitutes any limitation on the implementation process, and the specific execution order of each step should be based on its function and possible Internal logic is determined.
基于同一技术构思,本公开实施例中还提供了与图像标注方法对应的图像标注装置,由于本公开实施例中的装置解决问题的原理与本公开实施例上述图像标注方法相似,因此装置的实施可以参见方法的实施,重复之处不再赘述。Based on the same technical concept, the embodiment of the present disclosure also provides an image labeling device corresponding to the image labeling method. Reference may be made to the implementation of the method, and repeated descriptions will not be repeated.
参照图8所示,为本公开实施例提供的一种图像标注装置800的示意图,该图像标注装置800包括:Referring to FIG. 8 , which is a schematic diagram of an image labeling apparatus 800 provided by an embodiment of the present disclosure, the image labeling apparatus 800 includes:
图像获取模块801配置为:获取待进行标注的目标图像;The image acquisition module 801 is configured to: acquire the target image to be marked;
图像切分模块802配置为:对目标图像进行分块,得到多个图像块;The image segmentation module 802 is configured to: segment the target image to obtain multiple image blocks;
图像编码模块803配置为:对多个图像块中的每一图像块进行编码处理,得到各图像块对应的编码信息;The image encoding module 803 is configured to: perform encoding processing on each image block in the plurality of image blocks to obtain encoding information corresponding to each image block;
第一标注模块804配置为:对编码处理后的多个图像块中的部分图像块进行类别标注,得到标注图像块;The first labeling module 804 is configured to: perform category labeling on part of the image blocks in the plurality of image blocks after encoding processing, to obtain labelled image blocks;
类别确定模块805配置为:基于各图像块对应的编码信息以及标注图像块的编码信息,确定各图像块对应的类别信息;The category determining module 805 is configured to: determine the category information corresponding to each image block based on the encoding information corresponding to each image block and the encoding information annotating the image block;
第二标注模块806配置为:基于目标图像对应的标注方式以及各图像块对应的类别信息,对目标图像进行标注。The second labeling module 806 is configured to label the target image based on the labeling manner corresponding to the target image and the category information corresponding to each image block.
在一种实施方式中,图像编码模块803配置为:将各图像块输入神经网络,通过神经网络提取各图像块包含的图像特征;通过神经网络,基于各图像块的图像特征确定各图像块对应的编码信息。In one embodiment, the image encoding module 803 is configured to: input each image block into a neural network, extract image features included in each image block through the neural network; encoding information.
在一种实施方式中,第二标注模块806配置为:在标注方式为进行矩形框标注的情况下,获取对应类别信息相同的图像块;按照对应类别信息相同的图像块的最小外围矩形框对目标图像进行标注。In one embodiment, the second labeling module 806 is configured to: when the labeling method is to label a rectangular frame, obtain image blocks with the same corresponding category information; The target image is annotated.
在一种实施方式中,第二标注模块806配置为:在标注方式为进行轮廓标注的情况下,基于各图像块对应的类别信息以及各图像块包含的像素点,确定目标图像中各个像素点对应的类别信息;获取目标图像中各个像素点的属性特征,并基于各个像素点对应的类别信息以及属性特征,确定目标像素点,其中,目标像素点为待进行类别信息调整的像素点;在存在目标像素点的情况下,基于与目标像素点对应属性特征相同的像素点的类别信息,对目标像素点对应的类别信息进行调整,得到目标图像中各个像素点对应的目标类别信息;基于目标图像中各个像素点对应的目标类别信息,对属于同一目标类别的像素点构成的目标对象的轮廓进行标注。In one embodiment, the second labeling module 806 is configured to: when the labeling method is contour labeling, determine each pixel in the target image based on the category information corresponding to each image block and the pixels contained in each image block Corresponding category information; obtain the attribute features of each pixel in the target image, and determine the target pixel based on the category information and attribute features corresponding to each pixel, wherein the target pixel is the pixel to be adjusted for category information; in In the presence of target pixels, the category information corresponding to the target pixels is adjusted based on the category information of the pixels with the same attribute characteristics as the target pixels, and the target category information corresponding to each pixel in the target image is obtained; The target category information corresponding to each pixel in the image marks the contour of the target object composed of pixels belonging to the same target category.
在一种实施方式中,第二标注模块806配置为:选择各个像素点中的至少一个作为第一像素点;基于第一像素点的属性特征,确定第一像素点与第二像素点的属性特征的差异值;在差异值大于预设阈值的情况下,选择至少一个第三像素点,其中,第三像素点为具有与第一像素点相同的属性特征的像素点;在第一像素点对应的类别信息与第三像素点对应的类别信息不一致的情况下,将第一像素点作为目标像素点;其中,所述第二像素点与所述第一像素点相邻。In one embodiment, the second labeling module 806 is configured to: select at least one of the respective pixel points as the first pixel point; based on the attribute characteristics of the first pixel point, determine the attributes of the first pixel point and the second pixel point The difference value of the feature; when the difference value is greater than the preset threshold, at least one third pixel point is selected, wherein the third pixel point is a pixel point with the same attribute feature as the first pixel point; in the first pixel point When the corresponding category information is inconsistent with the category information corresponding to the third pixel point, the first pixel point is used as the target pixel point; wherein the second pixel point is adjacent to the first pixel point.
在一种实施方式中,第二标注模块配置为:在标注方式为进行分类标注的情况下,基于各图像块对应的类别信息,确定每种类别信息对应的图像块个数;基于每种类别信息对应的图像块个数,确定目标图像的类别信息。In one embodiment, the second labeling module is configured to: when the labeling method is to perform classification labeling, determine the number of image blocks corresponding to each class of information based on the class information corresponding to each image block; The number of image blocks corresponding to the information determines the category information of the target image.
在一种实施方式中,类别确定模块805配置为:对目标图像进行标注后,响应于针对目标图像块的标注类别更新指示,对标注图像块的类别信息进行更新;返回执行基于各图像块对应的编码信息以及标注图像块的编码信息,确定各图像块对应的类别信息的步骤。In one embodiment, the category determination module 805 is configured to: after annotating the target image, in response to an annotation category update instruction for the target image block, update the category information of the annotated image block; The step of determining the type information corresponding to each image block.
在一种可能的实施方式中,图像标注装置800还包括网络训练模块807,网络训练模块807配置为:获取多个样本图像,并对每个样本图像进行分块,得到多个样本图像块以及每个样本图像块的位置信息;基于每个样本图像块的位置信息,确定第一样本图像块对以及第二样本图像块对,其中,第一样本图像块对中的两个样本图像块之间的距离小于或等于设定阈值,以及第二样本图像块对中的两个样本图像块之间的距离大于设定阈值;分别将第一样本图像块对以及第二样本图像块对输入待训练的神经网络,得到每个样本图像块对应的预测编码信息;基于每个样本图像块对应的预测编码信息,对待训练的神经网络的网络参数进行调整,得到训练完成的用于进行编码的神经网络。In a possible implementation, the image labeling apparatus 800 further includes a network training module 807, and the network training module 807 is configured to: acquire multiple sample images, and divide each sample image into blocks to obtain multiple sample image blocks and position information of each sample image block; based on the position information of each sample image block, determine the first sample image block pair and the second sample image block pair, wherein the two sample images in the first sample image block pair The distance between the blocks is less than or equal to the set threshold, and the distance between the two sample image blocks in the second sample image block pair is greater than the set threshold; the first sample image block pair and the second sample image block are respectively For the input neural network to be trained, the predictive coding information corresponding to each sample image block is obtained; based on the predictive coding information corresponding to each sample image block, the network parameters of the neural network to be trained are adjusted, and the training completed is obtained. Encoded neural network.
关于装置中的各模块的处理流程、以及各模块之间的交互流程的描述可以参照上述方法实施例中 的相关说明,这里不再详述。For the description of the processing flow of each module in the apparatus and the interaction flow between the modules, reference may be made to the relevant descriptions in the foregoing method embodiments, which will not be described in detail here.
对应于图1中的图像标注方法,本公开实施例还提供了一种电子设备900,如图9所示,为本公开实施例提供的电子设备900结构示意图,包括:Corresponding to the image labeling method in FIG. 1 , an embodiment of the present disclosure further provides an electronic device 900 . As shown in FIG. 9 , the schematic structural diagram of the electronic device 900 provided by the embodiment of the present disclosure includes:
处理器91、存储器92、和总线93;存储器92用于存储执行指令,包括内存921和外部存储器922;这里的内存921也称内存储器,用于暂时存放处理器91中的运算数据,以及与硬盘等外部存储器922交换的数据,处理器91通过内存921与外部存储器922进行数据交换,当电子设备900运行时,处理器91与存储器92之间通过总线93通信,使得处理器91执行以下指令:获取待进行标注的目标图像;对目标图像进行分块,得到多个图像块;对多个图像块中的每一个进行编码处理,得到各图像块对应的编码信息;对编码处理后的多个图像块中的部分图像块进行类别标注,得到标注图像块;基于各图像块对应的编码信息以及标注图像块的编码信息,确定各图像块对应的类别信息;以及,基于目标图像对应的标注方式和各图像块对应的类别信息,对目标图像进行标注。The processor 91, the memory 92, and the bus 93; the memory 92 is used to store the execution instructions, including the memory 921 and the external memory 922; the memory 921 here is also called the internal memory, which is used to temporarily store the operation data in the processor 91, and For the data exchanged by the external memory 922 such as the hard disk, the processor 91 exchanges data with the external memory 922 through the memory 921. When the electronic device 900 is running, the communication between the processor 91 and the memory 92 is through the bus 93, so that the processor 91 executes the following instructions : obtain the target image to be marked; divide the target image into blocks to obtain multiple image blocks; perform coding processing on each of the multiple image blocks to obtain the coding information corresponding to each image block; Part of the image blocks in the image blocks are classified into categories to obtain labeled image blocks; based on the encoding information corresponding to each image block and the encoding information of the labeled image blocks, the category information corresponding to each image block is determined; and, based on the annotation corresponding to the target image The method and the corresponding category information of each image block are used to annotate the target image.
本公开实施例还提供一种计算机可读存储介质,该计算机可读存储介质上存储有计算机程序,该计算机程序被处理器运行时执行上述方法实施例中所述的图像标注方法的步骤。其中,该存储介质可以是易失性或非易失的计算机可读取存储介质。Embodiments of the present disclosure further provide a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and when the computer program is run by a processor, the steps of the image labeling method described in the foregoing method embodiments are executed. Wherein, the storage medium may be a volatile or non-volatile computer-readable storage medium.
本公开实施例还提供一种计算机程序,该计算机程序产包括计算机代码,在计算机代码在电子设备中运行的情况下,电子设备的处理器能够执行如前任一实施例所述的图像标注方法,具体可参见上述方法实施例,在此不再赘述。An embodiment of the present disclosure further provides a computer program, the computer program product includes computer code, and when the computer code runs in an electronic device, the processor of the electronic device can execute the image labeling method described in any of the preceding embodiments, For details, reference may be made to the foregoing method embodiments, which will not be repeated here.
其中,上述计算机程序产品可以具体通过硬件、软件或其结合的方式实现。在一个可选实施例中,所述计算机程序产品具体体现为计算机存储介质,在另一个可选实施例中,计算机程序产品具体体现为软件产品,例如软件开发包(Software Development Kit,SDK)等等。Wherein, the above-mentioned computer program product can be specifically implemented by means of hardware, software or a combination thereof. In an optional embodiment, the computer program product is embodied as a computer storage medium, and in another optional embodiment, the computer program product is embodied as a software product, such as a software development kit (Software Development Kit, SDK), etc. Wait.
所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述的系统和装置的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。在本公开所提供的几个实施例中,应该理解到,所揭露的系统、装置和方法,可以通过其它的方式实现。以上所描述的装置实施例仅仅是示意性的,例如,所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,又例如,多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些通信接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。Those skilled in the art can clearly understand that, for the convenience and brevity of description, for the specific working process of the system and device described above, reference may be made to the corresponding process in the foregoing method embodiments, which will not be repeated here. In the several embodiments provided by the present disclosure, it should be understood that the disclosed system, apparatus and method may be implemented in other manners. The apparatus embodiments described above are only illustrative. For example, the division of the units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components may be combined or Can be integrated into another system, or some features can be ignored, or not implemented. On the other hand, the shown or discussed mutual coupling or direct coupling or communication connection may be through some communication interfaces, indirect coupling or communication connection of devices or units, which may be in electrical, mechanical or other forms.
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。The units described as separate components may or may not be physically separated, and components displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution in this embodiment.
另外,在本公开各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。In addition, each functional unit in each embodiment of the present disclosure may be integrated into one processing unit, or each unit may exist physically alone, or two or more units may be integrated into one unit.
所述功能如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个处理器可执行的非易失的计算机可读取存储介质中。基于这样的理解,本公开的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本公开各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(Read-Only Memory,ROM)、随机存取存储器(Random Access Memory,RAM)、磁碟或者光盘等各种可以存储程序代码的介质。The functions, if implemented in the form of software functional units and sold or used as stand-alone products, may be stored in a processor-executable non-volatile computer-readable storage medium. Based on such understanding, the technical solutions of the present disclosure can be embodied in the form of software products in essence, or the parts that contribute to the prior art or the parts of the technical solutions. The computer software products are stored in a storage medium, including Several instructions are used to cause a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in various embodiments of the present disclosure. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), magnetic disk or optical disk and other media that can store program codes .
最后说明的是:以上所述实施例,仅为本公开的具体实施方式,用以说明本公开的技术方案而非对其限制,本公开的保护范围并不局限于此,尽管参照前述实施例对本公开进行了详细的说明,本领域的普通技术人员应当理解:任何熟悉本技术领域的技术人员在本公开揭露的技术范围内,其依然可以对前述实施例所记载的技术方案进行修改或可轻易想到变化,或者对其中部分技术特征进行等同替换;而这些修改、变化或者替换,并不使相应技术方案的本质脱离本公开实施例技术方案的精神和范围,都应涵盖在本公开的保护范围之内。因此,本公开的保护范围应所述以权利要求的保护范围为准。Finally, it should be noted that the above-mentioned embodiments are only specific implementations of the present disclosure, and are used to illustrate the technical solutions of the present disclosure rather than limit them. The protection scope of the present disclosure is not limited thereto, although referring to the aforementioned embodiments The present disclosure has been described in detail, and those of ordinary skill in the art should understand that any person skilled in the art can still modify or modify the technical solutions described in the foregoing embodiments within the technical scope disclosed in the present disclosure. Changes are easily thought of, or equivalent replacements are made to some of the technical features; and these modifications, changes or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present disclosure, and should be included in the protection of the present disclosure. within the range. Therefore, the protection scope of the present disclosure should be based on the protection scope of the claims.
工业实用性Industrial Applicability
本公开实施例公开了一种图像标注方法、装置、电子设备、存储介质及程序,所述方法包括:获取待进行标注的目标图像;对所述目标图像进行分块,得到多个图像块;对所述多个图像块中的每一图像块进行编码处理,得到各图像块对应的编码信息;对编码处理后的所述多个图像块中的部分图像块进行类别标注,得到标注图像块;基于所述各图像块对应的编码信息以及所述标注图像块的编码信息,确定所述各图像块对应的类别信息;基于所述目标图像对应的标注方式以及所述各图像块对应的类别信息,对所述目标图像进行标注。通过本公开实施例提供的图像标注方法,能够在医疗领域中快速标注出病人器官图像中的病灶区域,从而有效辅助用户进行临床诊断。The embodiments of the present disclosure disclose an image labeling method, device, electronic device, storage medium and program, the method includes: acquiring a target image to be labelled; dividing the target image into blocks to obtain a plurality of image blocks; Perform encoding processing on each image block in the plurality of image blocks to obtain encoding information corresponding to each image block; perform category labeling on some image blocks in the plurality of image blocks after encoding processing to obtain labeled image blocks ; Based on the coding information corresponding to each image block and the coding information of the labeled image block, determine the category information corresponding to each image block; Based on the corresponding labeling method of the target image and the corresponding category of each image block information, and annotate the target image. With the image labeling method provided by the embodiments of the present disclosure, the lesion area in the patient's organ image can be quickly labelled in the medical field, thereby effectively assisting the user in clinical diagnosis.

Claims (12)

  1. 一种图像标注方法,所述方法包括:An image labeling method, the method comprising:
    获取待进行标注的目标图像;Obtain the target image to be annotated;
    对所述目标图像进行分块,得到多个图像块;The target image is divided into blocks to obtain a plurality of image blocks;
    对所述多个图像块中的每一图像块进行编码处理,得到各图像块对应的编码信息;performing encoding processing on each image block in the plurality of image blocks to obtain encoding information corresponding to each image block;
    对编码处理后的所述多个图像块中的部分图像块进行类别标注,得到标注图像块;Perform category labeling on some image blocks in the plurality of image blocks after encoding processing, to obtain labeled image blocks;
    基于所述各图像块对应的编码信息以及所述标注图像块的编码信息,确定所述各图像块对应的类别信息;以及基于所述目标图像对应的标注方式以及所述各图像块对应的类别信息,对所述目标图像进行标注。Determine the category information corresponding to each image block based on the encoding information corresponding to each image block and the encoding information of the labeled image block; and based on the corresponding labeling method of the target image and the category corresponding to each image block information, and annotate the target image.
  2. 根据权利要求1所述的图像标注方法,其中,对所述多个图像块中的每一图像块进行编码处理,得到各图像块对应的编码信息,包括:The image labeling method according to claim 1, wherein encoding each image block in the plurality of image blocks is performed to obtain encoding information corresponding to each image block, comprising:
    将所述各图像块输入神经网络,通过所述神经网络提取所述各图像块包含的图像特征;Inputting the image blocks into a neural network, and extracting the image features contained in the image blocks through the neural network;
    通过所述神经网络,基于所述各图像块的图像特征确定所述各图像块对应的编码信息。Through the neural network, the coding information corresponding to each image block is determined based on the image feature of each image block.
  3. 根据权利要求1或2所述的图像标注方法,其中,所述基于所述目标图像对应的标注方式以及所述各图像块对应的类别信息,对所述目标图像进行标注,包括:The image labeling method according to claim 1 or 2, wherein the labeling of the target image based on the labeling manner corresponding to the target image and the category information corresponding to each image block comprises:
    在所述标注方式为进行矩形框标注的情况下,获取对应类别信息相同的图像块;以及In the case where the labeling method is to label a rectangular frame, obtain image blocks with the same corresponding category information; and
    按照所述对应类别信息相同的图像块的最小外围矩形框对所述目标图像进行标注。The target image is marked according to the smallest peripheral rectangular frame of the image blocks with the same corresponding category information.
  4. 根据权利要求1或2所述的图像标注方法,其中,所述基于所述目标图像对应的标注方式以及所述各图像块对应的类别信息,对所述目标图像进行标注,包括:The image labeling method according to claim 1 or 2, wherein the labeling of the target image based on the labeling manner corresponding to the target image and the category information corresponding to each image block comprises:
    在所述标注方式为进行轮廓标注的情况下,基于所述各图像块对应的类别信息以及所述各图像块包含的像素点,确定所述目标图像中各个像素点对应的类别信息;In the case where the labeling method is contour labeling, the class information corresponding to each pixel point in the target image is determined based on the class information corresponding to each image block and the pixel points included in each image block;
    获取所述目标图像中各个像素点的属性特征,基于所述各个像素点对应的类别信息以及属性特征,确定目标像素点;其中,所述目标像素点为待进行类别信息调整的像素点;Acquiring attribute features of each pixel in the target image, and determining the target pixel based on the category information and attribute features corresponding to each pixel; wherein, the target pixel is a pixel to be adjusted for category information;
    在存在所述目标像素点的情况下,基于与所述目标像素点对应属性特征相同的像素点的类别信息,对所述目标像素点对应的类别信息进行调整,得到所述目标图像中各个像素点对应的目标类别信息;以及In the case where the target pixel exists, the category information corresponding to the target pixel is adjusted based on the category information of the pixel with the same attribute feature as the target pixel to obtain each pixel in the target image. the target category information corresponding to the point; and
    基于所述目标图像中所述各个像素点对应的目标类别信息,对属于同一目标类别的像素点构成的目标对象的轮廓进行标注。Based on the target category information corresponding to each pixel in the target image, an outline of a target object formed by pixels belonging to the same target category is marked.
  5. 根据权利要求4所述的图像标注方法,其中,所述基于各个像素点对应的类别信息以及属性特征,确定目标像素点,包括:The image labeling method according to claim 4, wherein the determining the target pixel point based on the category information and attribute characteristics corresponding to each pixel point comprises:
    选择所述各个像素点中的至少一个作为第一像素点;Selecting at least one of the respective pixel points as the first pixel point;
    基于所述第一像素点的属性特征,确定所述第一像素点与第二像素点的属性特征的差异值;其中,所述第二像素点与所述第一像素点相邻;Based on the attribute feature of the first pixel point, the difference value of the attribute feature of the first pixel point and the second pixel point is determined; wherein, the second pixel point is adjacent to the first pixel point;
    在所述差异值大于预设阈值的情况下,选择至少一个第三像素点;其中,所述第三像素点为具有与所述第一像素点相同的属性特征的像素点;以及In the case that the difference value is greater than a preset threshold, at least one third pixel is selected; wherein, the third pixel is a pixel having the same attribute characteristics as the first pixel; and
    在所述第一像素点对应的类别信息与所述第三像素点对应的类别信息不一致的情况下,将所述第一像素点作为所述目标像素点。When the category information corresponding to the first pixel point is inconsistent with the category information corresponding to the third pixel point, the first pixel point is used as the target pixel point.
  6. 根据权利要求1或2所述的图像标注方法,其中,所述基于所述目标图像对应的标注方式以及所述各图像块对应的类别信息,对所述目标图像进行标注,包括:The image labeling method according to claim 1 or 2, wherein the labeling of the target image based on the labeling method corresponding to the target image and the category information corresponding to each image block comprises:
    在所述标注方式为进行分类标注的情况下,基于各图像块对应的类别信息,确定每种类别信息对应的图像块个数;以及In the case where the labeling method is to perform classification labeling, based on the class information corresponding to each image block, determine the number of image blocks corresponding to each class of information; and
    基于每种类别信息对应的图像块个数,确定所述目标图像的类别信息。The category information of the target image is determined based on the number of image blocks corresponding to each category of information.
  7. 根据权利要求1至6任一所述的图像标注方法,其中,所述方法还包括:The image labeling method according to any one of claims 1 to 6, wherein the method further comprises:
    对所述目标图像进行标注后,响应于针对目标图像块的标注类别更新指示,对所述标注图像块的 类别信息进行更新;以及After the target image is marked, in response to the marking category update instruction for the target image block, the category information of the marked image block is updated; and
    返回执行基于所述各图像块对应的编码信息以及所述标注图像块的编码信息,确定所述各图像块对应的类别信息的步骤。Return to perform the step of determining the category information corresponding to each image block based on the encoding information corresponding to each image block and the encoding information of the marked image block.
  8. 根据权利要求2所述的图像标注方法,其中,所述神经网络是通过以下方式得到:The image labeling method according to claim 2, wherein the neural network is obtained by:
    获取多个样本图像,并对每个样本图像进行分块,得到多个样本图像块以及每个样本图像块的位置信息;Acquire multiple sample images, and divide each sample image into blocks to obtain multiple sample image blocks and position information of each sample image block;
    基于每个样本图像块的位置信息,确定第一样本图像块对以及第二样本图像块对;其中,所述第一样本图像块对中的两个样本图像块之间的距离小于或等于设定阈值;所述第二样本图像块对中的两个样本图像块之间的距离大于所述设定阈值;Based on the position information of each sample image block, a first sample image block pair and a second sample image block pair are determined; wherein the distance between the two sample image blocks in the first sample image block pair is less than or is equal to a set threshold; the distance between two sample image blocks in the second sample image block pair is greater than the set threshold;
    分别将所述第一样本图像块对以及所述第二样本图像块对输入待训练的神经网络,得到每个样本图像块对应的预测编码信息;以及respectively inputting the first sample image block pair and the second sample image block pair into the neural network to be trained, to obtain predictive coding information corresponding to each sample image block; and
    基于每个样本图像块对应的预测编码信息,对所述待训练的神经网络的网络参数进行调整,得到训练完成的用于进行编码的神经网络。Based on the predictive coding information corresponding to each sample image block, the network parameters of the neural network to be trained are adjusted to obtain a trained neural network for coding.
  9. 一种图像标注装置,包括:An image labeling device, comprising:
    图像获取模块配置为:获取待进行标注的目标图像;The image acquisition module is configured to: acquire the target image to be marked;
    图像切分模块配置为:对所述目标图像进行分块,得到多个图像块;The image segmentation module is configured to: block the target image to obtain a plurality of image blocks;
    图像编码模块配置为:对所述多个图像块中的每一图像块进行编码处理,得到各图像块对应的编码信息;The image encoding module is configured to: perform encoding processing on each image block in the plurality of image blocks to obtain encoding information corresponding to each image block;
    第一标注模块配置为:对编码处理后的所述多个图像块中的部分图像块进行类别标注,得到标注图像块;The first labeling module is configured to: perform category labeling on some image blocks in the plurality of image blocks after encoding processing, to obtain labelled image blocks;
    类别确定模块配置为:基于各图像块对应的编码信息以及所述标注图像块的编码信息,确定各图像块对应的类别信息;以及The category determination module is configured to: determine the category information corresponding to each image block based on the encoding information corresponding to each image block and the encoding information of the marked image block; and
    第二标注模块配置为:基于所述目标图像对应的标注方式以及所述各图像块对应的类别信息,对所述目标图像进行标注。The second labeling module is configured to label the target image based on the labeling manner corresponding to the target image and the category information corresponding to each image block.
  10. 一种电子设备,包括:处理器、存储器以及总线,所述存储器存储有所述处理器可执行的机器可读指令,当电子设备运行时,所述处理器与所述存储器之间通过总线通信,所述机器可读指令被所述处理器执行时执行如权利要求1至8任一所述的图像标注方法。An electronic device, comprising: a processor, a memory and a bus, the memory stores machine-readable instructions executable by the processor, and when the electronic device is running, the processor and the memory communicate through the bus , when the machine-readable instructions are executed by the processor, the image labeling method according to any one of claims 1 to 8 is executed.
  11. 一种计算机可读存储介质,该计算机可读存储介质上存储有计算机程序,该计算机程序被处理器运行时执行如权利要求1至8任一所述的图像标注方法。A computer-readable storage medium, on which a computer program is stored, and when the computer program is run by a processor, the image annotation method according to any one of claims 1 to 8 is executed.
  12. 一种计算机程序,所述计算机程序包括计算机可读代码,在所述计算机可读代码在电子设备中运行的情况下,所述电子设备的处理器执行用于实现如权利要求1至8任一所述的图像标注方法。A computer program, the computer program comprising computer-readable codes, when the computer-readable codes are executed in an electronic device, the processor of the electronic device executes the code for realizing any one of claims 1 to 8 The described image annotation method.
PCT/CN2021/118580 2021-01-28 2021-09-15 Image annotation method and apparatus, electronic device, storage medium and program WO2022160736A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202110116990.5A CN112925938A (en) 2021-01-28 2021-01-28 Image annotation method and device, electronic equipment and storage medium
CN202110116990.5 2021-01-28

Publications (1)

Publication Number Publication Date
WO2022160736A1 true WO2022160736A1 (en) 2022-08-04

Family

ID=76168410

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/118580 WO2022160736A1 (en) 2021-01-28 2021-09-15 Image annotation method and apparatus, electronic device, storage medium and program

Country Status (2)

Country Link
CN (1) CN112925938A (en)
WO (1) WO2022160736A1 (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112925938A (en) * 2021-01-28 2021-06-08 上海商汤智能科技有限公司 Image annotation method and device, electronic equipment and storage medium
CN113343999B (en) * 2021-06-15 2022-04-08 萱闱(北京)生物科技有限公司 Target boundary recording method and device based on target detection and computing equipment
CN114092489B (en) * 2021-11-02 2023-08-29 清华大学 Porous medium seepage channel extraction and model training method, device and equipment
CN114237441A (en) * 2021-11-15 2022-03-25 维沃移动通信有限公司 Information display method and device

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2008061913A1 (en) * 2006-11-21 2008-05-29 Agfa Healthcare Inc. System and method for image annotation based on object- plane intersections
US10198782B1 (en) * 2016-09-15 2019-02-05 Digimarc Corporation Detecting conflicts between multiple different encoded signals within imagery
CN109658481A (en) * 2018-12-24 2019-04-19 北京旷视科技有限公司 Image labeling method and device, feature drawing generating method and device
CN110189333A (en) * 2019-05-22 2019-08-30 湖北亿咖通科技有限公司 A kind of picture semantic divides semi-automatic mask method and device
CN110222772A (en) * 2019-06-10 2019-09-10 浙江大学 A kind of medical image mark recommended method based on block rank Active Learning
CN111739035A (en) * 2020-06-30 2020-10-02 腾讯科技(深圳)有限公司 Image processing method, device and equipment based on artificial intelligence and storage medium
CN112925938A (en) * 2021-01-28 2021-06-08 上海商汤智能科技有限公司 Image annotation method and device, electronic equipment and storage medium

Family Cites Families (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108229267B (en) * 2016-12-29 2020-10-16 北京市商汤科技开发有限公司 Object attribute detection, neural network training and region detection method and device
CN108615236A (en) * 2018-05-08 2018-10-02 上海商汤智能科技有限公司 A kind of image processing method and electronic equipment
CN109117760B (en) * 2018-07-27 2021-01-22 北京旷视科技有限公司 Image processing method, image processing device, electronic equipment and computer readable medium
CN109299716B (en) * 2018-08-07 2021-07-06 北京市商汤科技开发有限公司 Neural network training method, image segmentation method, device, equipment and medium
CN111626313B (en) * 2019-02-28 2023-06-02 银河水滴科技(北京)有限公司 Feature extraction model training method, image processing method and device
CN109840914B (en) * 2019-02-28 2022-12-16 华南理工大学 Texture segmentation method based on user interaction
CN110264443B (en) * 2019-05-20 2024-04-16 平安科技(深圳)有限公司 Fundus image lesion labeling method, device and medium based on feature visualization
CN110211134B (en) * 2019-05-30 2021-11-05 上海商汤智能科技有限公司 Image segmentation method and device, electronic equipment and storage medium
CN110533086B (en) * 2019-08-13 2021-01-26 天津大学 Semi-automatic image data labeling method
CN111368923B (en) * 2020-03-05 2023-12-19 上海商汤智能科技有限公司 Neural network training method and device, electronic equipment and storage medium
CN111489366B (en) * 2020-04-15 2024-06-11 上海商汤临港智能科技有限公司 Training and image semantic segmentation method and device for neural network
CN111932547B (en) * 2020-09-24 2021-06-11 平安科技(深圳)有限公司 Method and device for segmenting target object in image, electronic device and storage medium

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2008061913A1 (en) * 2006-11-21 2008-05-29 Agfa Healthcare Inc. System and method for image annotation based on object- plane intersections
US10198782B1 (en) * 2016-09-15 2019-02-05 Digimarc Corporation Detecting conflicts between multiple different encoded signals within imagery
CN109658481A (en) * 2018-12-24 2019-04-19 北京旷视科技有限公司 Image labeling method and device, feature drawing generating method and device
CN110189333A (en) * 2019-05-22 2019-08-30 湖北亿咖通科技有限公司 A kind of picture semantic divides semi-automatic mask method and device
CN110222772A (en) * 2019-06-10 2019-09-10 浙江大学 A kind of medical image mark recommended method based on block rank Active Learning
CN111739035A (en) * 2020-06-30 2020-10-02 腾讯科技(深圳)有限公司 Image processing method, device and equipment based on artificial intelligence and storage medium
CN112925938A (en) * 2021-01-28 2021-06-08 上海商汤智能科技有限公司 Image annotation method and device, electronic equipment and storage medium

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
GUANGJIAN TIAN ; HONG FU ; D.D. FENG: "Automatic medical image categorization and annotation using LBP and MPEG-7 edge histograms", TECHNOLOGY AND APPLICATIONS IN BIOMEDICINE, 2008. ITAB 2008. INTERNATIONAL CONFERENCE ON, IEEE, PISCATAWAY, NJ, USA, 30 May 2008 (2008-05-30), Piscataway, NJ, USA , pages 51 - 53, XP031289315, ISBN: 978-1-4244-2254-8 *
YU MIN: "Research of Image Annotation Base on Regional Segmentation", CHINA MASTER'S THESES FULL-TEXT DATABASE, INFORMATION TECHNOLOGY, no. 2, 15 February 2017 (2017-02-15), XP055954888 *

Also Published As

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

Similar Documents

Publication Publication Date Title
WO2022160736A1 (en) Image annotation method and apparatus, electronic device, storage medium and program
WO2021012484A1 (en) Deep learning-based target tracking method and apparatus, and computer readable storage medium
Cheng et al. Global contrast based salient region detection
Ban et al. Face detection based on skin color likelihood
Liasis et al. Building extraction in satellite images using active contours and colour features
CN111476284A (en) Image recognition model training method, image recognition model training device, image recognition method, image recognition device and electronic equipment
US20190019052A1 (en) Text Region Detection in Digital Images using Image Tag Filtering
CN112287187A (en) Using an object property detection model to automatically select instances of objects detected in an image
CN105493078B (en) Colored sketches picture search
WO2021082168A1 (en) Method for matching specific target object in scene image
WO2021184718A1 (en) Card border recognition method, apparatus and device, and computer storage medium
CN113762309B (en) Object matching method, device and equipment
US8027978B2 (en) Image search method, apparatus, and program
CN112418216A (en) Method for detecting characters in complex natural scene image
WO2015042891A1 (en) Image semantic segmentation method and apparatus
CN110889437B (en) Image processing method and device, electronic equipment and storage medium
CN112380978B (en) Multi-face detection method, system and storage medium based on key point positioning
Zhang et al. Saliency detection via local structure propagation
KR20220004009A (en) Key point detection method, apparatus, electronic device and storage medium
CN106980866B (en) Shoe retrieval method and device
CN114565035A (en) Tongue picture analysis method, terminal equipment and storage medium
Huo et al. Semisupervised learning based on a novel iterative optimization model for saliency detection
CN107357834A (en) Image retrieval method based on visual saliency fusion
Kim et al. Robust facial landmark extraction scheme using multiple convolutional neural networks
CN108694411B (en) Method for identifying similar images

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 21922328

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 21922328

Country of ref document: EP

Kind code of ref document: A1

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 170124)

122 Ep: pct application non-entry in european phase

Ref document number: 21922328

Country of ref document: EP

Kind code of ref document: A1