Method, device, electronic device and storage medium for generating annotation specifications
By automatically extracting key frames and annotation tool information from medical annotation videos and generating annotation specifications, the problem of low accuracy and resource waste caused by manual extraction in the existing technology is solved, and efficient annotation specification generation is achieved.
Patent Information
- Application Number
- CN202110772688.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-07-08
- Publication Date
- 2024-09-13
- Estimated Expiration
- 2041-07-08
AI Technical Summary
In the existing technology, producing medical annotation specifications requires manual extraction of key frames, resulting in low accuracy and waste of human resources and time resources.
By obtaining medical annotation videos, extracting annotation key frames, determining annotation tools, annotation content and timing, and generating template sentences based on this information to form annotation specifications, the entire process does not require manual participation.
It improves the accuracy of labeling specification generation and avoids unnecessary waste of manpower and time resources.
Smart Images

Figure CN113506610B
Abstract
Description
Technical Field
[0001] Embodiments of the present invention relate to the field of image processing, and in particular to a method, device, electronic device and storage medium for generating a labeling specification. Background Art
[0002] Medical image annotation is different from medical text annotation. Image annotation often requires experienced radiologists to annotate, and the cost of manual annotation is high. When faced with complex annotation of a large number of medical images, it is often necessary to create different annotation specifications for different annotation tasks as annotation tutorials for the training of annotators, so that annotators can quickly understand the annotation rules and master the annotation methods.
[0003] In the prior art, annotation specifications are prepared by manually extracting key frames containing annotation explanations from medical annotation videos, and then forming annotation specifications based on the extracted key frames to provide them to medical annotators for learning and review. However, the use of prior art to prepare medical annotation specifications requires manual extraction of key frames, which is prone to errors and has low accuracy, and also wastes a lot of human resources and time resources. Summary of the invention
[0004] The embodiments of the present invention provide a method, device, electronic device and storage medium for generating a labeling specification, so as to realize a labeling process without human intervention, improve the accuracy of the labeling specification generating process, and avoid unnecessary waste of human resources and time resources.
[0005] In a first aspect, an embodiment of the present invention provides a method for generating a labeling specification, which may include:
[0006] Obtain a target video including a target medical annotation process, and extract annotated key frames in the target video;
[0007] Determine the target annotation tool in each annotation key frame, and determine the annotation content and annotation timing corresponding to each target annotation tool;
[0008] A current template sentence matching the current annotation key frame is generated based on the annotation content and the annotation timing, and an annotation specification is generated based on each annotation key frame and the template sentence matching the annotation key frame.
[0009] In a second aspect, an embodiment of the present invention further provides a device for generating a labeling specification, comprising:
[0010] A target video acquisition module is used to acquire a target video including a target medical annotation process and extract annotated key frames in the target video;
[0011] A determination module is used to determine the target annotation tool in each annotation key frame, and determine the annotation content and annotation timing corresponding to each target annotation tool;
[0012] The annotation specification generation module is used to generate a current template sentence matching the current annotation key frame based on the annotation content and the annotation timing, and generate annotation specifications based on each annotation key frame and the template sentence matching the annotation key frame.
[0013] In a third aspect, an embodiment of the present invention further provides an electronic device, including:
[0014] one or more processors;
[0015] A memory for storing one or more programs;
[0016] When one or more programs are executed by one or more processors, the one or more processors implement the annotation specification generation method provided by any embodiment of the present invention.
[0017] In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the annotation specification generating method provided by any embodiment of the present invention.
[0018] A method for generating an annotation specification provided by an embodiment of the present invention obtains a target video including a target medical annotation process, extracts annotation key frames in the target video, and reflects the target medical annotation process through the annotation key frames. Determine the target annotation tool in each annotation key frame, determine the annotation content and annotation timing corresponding to each target annotation tool; generate a current template sentence matching the current annotation key frame based on the annotation content and annotation timing, and generate an annotation specification based on each annotation key frame and the template sentence matching the annotation key frame. It can be seen that the template sentence is obtained by determining the annotation content and annotation timing corresponding to the target annotation tool in each annotation key frame, and the template sentence and each annotation key frame can form an annotation specification. The entire process does not require manual operation, which improves the accuracy of the annotation specification generation process and avoids unnecessary waste of human resources and time resources.
[0019] In addition, a labeling specification generating device, electronic device and storage medium provided by the present invention correspond to the above method and have the same beneficial effects. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] In order to more clearly illustrate the embodiments of the present invention, the following briefly introduces the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0021] Figure 1 A flowchart of a method for generating a labeling specification provided by an embodiment of the present invention;
[0022] Figure 2 A flowchart of another method for generating a labeling specification provided by an embodiment of the present invention;
[0023] Figure 3 A schematic diagram of a method for generating a labeling specification in an application scenario provided by an embodiment of the present invention;
[0024] Figure 4 A structural diagram of a device for generating a marking specification provided by an embodiment of the present invention;
[0025] Figure 5 A structural diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0026] The following will be combined with the accompanying drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. It is understood that the specific embodiments described herein are only used to explain the present invention, rather than to limit the present invention. It should also be noted that, for the convenience of description, only the parts related to the present invention, rather than all structures, are shown in the accompanying drawings.
[0027] The core of the present invention is to provide a method, device, electronic device and storage medium for generating annotation specifications, so as to realize the annotation process without human participation, improve the accuracy of the annotation specification generation process, and avoid unnecessary waste of human and time resources.
[0028] In order to enable those skilled in the art to better understand the solution of the present invention, the present invention is further described in detail below in conjunction with the accompanying drawings and specific implementation methods.
[0029] Embodiment 1
[0030] Figure 1 A flowchart of a method for generating a labeling specification provided by an embodiment of the present invention. The method can be executed by a device for generating a labeling specification provided by an embodiment of the present invention, which can be implemented by software and / or hardware, and can be integrated in various user terminals or servers.
[0031] like Figure 1 As shown, the method of the embodiment of the present invention specifically includes the following steps:
[0032] S101, obtaining a target video including a target medical annotation process, and extracting annotated key frames in the target video.
[0033] In a specific implementation, in order to generate a graphic annotation specification for training annotation personnel, a target video containing a target medical annotation process can be first obtained. The medical process that needs to be trained can be used as the target medical process. For example, if the annotation specification of pathological slice images needs to be trained, the annotation process of medical record slice images can be used as the target medical annotation process, and the pathological slice annotation process video can be used as the target video. Furthermore, the annotation tools used to annotate the target medical process can include rectangular boxes, arrows, elliptical boxes, etc.
[0034] Optionally, after acquiring the target video containing the target medical annotation process, the annotated key frames in the target video can be extracted. Specifically, the video frames that meet the definition requirements in the target video can be extracted as the annotated key frames, thereby eliminating the video frames with blurred and dark images in the target video, and ensuring the image quality of the extracted annotated key frames.
[0035] S102: Determine the target annotation tool in each annotation key frame, and determine the annotation content and annotation timing corresponding to each target annotation tool.
[0036] Optionally, different annotation tools may be used to represent different annotation meanings. An annotation tool that needs to be reflected in the annotation specification may be pre-set as a target annotation tool, and the target annotation tool in each annotation keyframe may be determined.
[0037] Exemplarily, the number of target annotation tools is at least one. The generation time corresponding to each target annotation tool in the target video is determined as the annotation time of the target annotation tool, and the content annotated by the target annotation tool in the corresponding annotation key frame is determined as the annotation content. According to the order of the annotation time of each target annotation tool from early to late, the annotation timing of each target annotation tool can be determined, thereby reflecting the steps of the annotation process.
[0038] For example, when the labeling specification needs to reflect how to label the lesion site, and the lesion site is labeled with a rectangular box in the target video, the rectangular box can be set as the target labeling tool in advance, and the labeling content corresponding to the rectangular box and the labeling time of each rectangular box can be determined in each extracted labeling key frame. The labeling timing can be determined through the labeling time of each rectangular box.
[0039] S103 : Generate a current template sentence pattern that matches the current annotation key frame based on the annotation content and the annotation timing, and generate an annotation specification based on each annotation key frame and the template sentence pattern that matches the annotation key frame.
[0040] Based on the annotation content and the annotation timing, a template sentence for explaining the annotation process contained in the current annotation keyframe can be generated. Optionally, the template sentence can display the preset position of the current annotation keyframe in the form of text to form an annotation specification combining text and images.
[0041] Exemplarily, the target annotation tool is an arrow, and the arrow appears twice in the current annotation keyframe. The annotation content corresponding to the first arrow is the starting position of the lesion, and the annotation content corresponding to the second arrow is the ending position of the lesion. Based on the annotation content and annotation timing, the current template sentence generated to match the current annotation keyframe is "use arrows to point to the starting position and the ending position of the lesion respectively."
[0042] Furthermore, the enlarged spherical cursor that appears when a mouse, touch pen or other device performs a click operation can be used as a target annotation tool, and the click operation can be identified by identifying the trajectory of the enlarged spherical cursor. A template sentence is generated based on the annotation content and annotation timing corresponding to the click operation and each target annotation tool. The template sentence is combined with each annotation keyframe to generate an illustrated annotation specification as a tutorial for training annotation personnel. For example, the template sentence can be "Click the "**" button with the mouse, enter "**" in the input box and confirm, click the "**" button with the mouse, a "rectangular box" appears, drag the "rectangular box" to the lesion site, and perform image annotation. At this time, the measurement value will be "**", click the "color" button to change the color of the label to "**", ..., click the "**" button with the mouse to end this step."
[0043] A method for generating an annotation specification provided by an embodiment of the present invention obtains a target video including a target medical annotation process, extracts annotation key frames in the target video, and reflects the target medical annotation process through the annotation key frames. Determine the target annotation tool in each annotation key frame, determine the annotation content and annotation timing corresponding to each target annotation tool; generate a current template sentence matching the current annotation key frame based on the annotation content and annotation timing, and generate an annotation specification based on each annotation key frame and the template sentence matching the annotation key frame. It can be seen that the template sentence is obtained by determining the annotation content and annotation timing corresponding to the target annotation tool in each annotation key frame, and the template sentence and each annotation key frame can form an annotation specification. The entire process does not require manual operation, which improves the accuracy of the annotation specification generation process and avoids unnecessary waste of human resources and time resources.
[0044] Embodiment 2
[0045] Figure 2A flowchart of another method for generating annotation specifications provided by an embodiment of the present invention. This embodiment is optimized based on the above-mentioned technical solutions. Optionally, determining the target annotation tool in each annotation key frame includes: based on a pre-established annotation tool detection model, performing a detection operation on each annotation key frame; determining the target annotation tool based on the annotation tools detected in each annotation key frame. Optionally, obtaining a target video containing a target medical annotation process includes: obtaining each video containing a target medical annotation process and the annotator corresponding to each video; calculating the annotation score of each annotator based on the annotation time, annotation pass rate and annotation rejection rate of the annotator; and determining the video annotated by the annotator with the highest annotation score as the target video. Optionally, extracting the annotation key frames in the target video includes: performing a shot segmentation operation on the target video to generate at least two video clips; extracting the key frames in each video clip, and using the key frames corresponding to each video clip as the annotation key frames of the target video. Among them, the explanations of the terms that are the same or corresponding to the above-mentioned embodiments are not repeated here.
[0046] Figure 2 A flowchart of another method for generating a label specification provided by an embodiment of the present invention; Figure 2 As shown, the method of the embodiment of the present invention specifically includes the following steps:
[0047] S201, obtaining each video containing the target medical annotation process and the annotator corresponding to each video, calculating the annotation score of each annotator based on the annotation time, annotation pass rate and annotation rejection rate of the annotator, and determining the video annotated by the annotator with the highest annotation score as the target video.
[0048] In the specific implementation, in order to ensure the accuracy and high annotation effect of the acquired target video, the video annotated by the annotator with a high score can be selected as the target video. For example, based on the annotation time, annotation pass rate, and annotation rejection rate in the annotator's historical annotation results, an annotation score that reflects the annotation level of the annotator can be calculated. The annotation score calculation formula is as follows:
[0049] Score=k1*p1-k1*r1-k2*t1
[0050] Among them, Score is the annotation score, k1, k2, k3 are the weights corresponding to the annotation pass rate, annotation rejection rate and annotation time respectively, p1 is the annotation one-time pass rate, r1 is the annotation rejection rate, and t1 is the annotation time.
[0051] Specifically, the labelers can be divided into three levels: excellent, good, and poor according to the labeling scores. The video containing the target medical labeling process labeled by the excellent labelers can be selected as the target video; or the video labeled by the labeler with the highest labeling score among the videos containing the target medical labeling process can be determined as the target video.
[0052] S202: Perform a shot segmentation operation on the target video to generate at least two video segments, extract key frames from each video segment, and use the key frames corresponding to each video segment as labeled key frames of the target video.
[0053] In a specific implementation, a shot segmentation operation is performed on the determined target video. Specifically, the histogram frame difference information can be obtained based on the histogram information of the target video, the position of the maximum value of the frame difference can be calculated, and the position is used as a segmentation point for segmentation, so as to segment the target video into at least two video segments.
[0054] For each segmented video segment, extract the key frame in each video segment. Optionally, extracting the key frame in each video segment includes: determining the brightness value of each video frame in each video segment, determining each video frame whose brightness value is greater than a preset threshold; and determining the key frame in each video segment based on each video frame whose brightness value is greater than the preset threshold.
[0055] Specifically, in order to obtain a good annotation specification for image quality, the video frames with low brightness that affect viewing in each video clip can be removed to obtain the key frames in each video clip. Exemplarily, the brightness value of each video frame in each video clip can be determined. The video frame consists of three channels: red, green, and blue. For the preset weight of each channel, a quality brightness map of each video frame in the video clip is obtained. Exemplarily, the preset weights of the red, green, and blue channels can be 0.2, 0.7, and 0.1, respectively. The pixels of each brightness map are normalized and the average value is taken to obtain the brightness value of each video frame. The brightness value calculation formula is as follows:
[0056]
[0057] Where i, j represent the pixels in each video frame; m, n represent the width and height of each video frame; I r Represents the red channel image, I g Represents the green channel image, I b Represents the blue channel image, and y1 is the brightness value of the video frame.
[0058] Specifically, the larger the brightness value of the obtained video frame is, the brighter the video frame is. Determine each video frame whose brightness value is greater than a preset threshold; based on each video frame whose brightness value is greater than the preset threshold, determine the key frame in each video segment. Exemplarily, the brightness value range is [0,1], the preset threshold is a hyperparameter, set to 0.08, and based on the video frames whose brightness value is greater than 0.08, determine the key frame in each video segment.
[0059] Optionally, based on each video frame having a brightness value greater than a preset threshold, a key frame in each video clip is determined, including: converting each video frame having a brightness greater than a preset threshold into a grayscale video frame; calculating the sharpness value of each grayscale video frame; and determining each video frame corresponding to each grayscale video frame having a sharpness value greater than a preset sharpness value as a key frame of the video clip.
[0060] Specifically, in order to obtain a good image quality annotation specification, the blurred video frames in each video clip can be deleted to obtain the key frames in each video clip. The grayscale image of each video frame is used to filter the blurred video frames. If the sharpness of the video frame is higher, it means that the detail contrast of the video frame is higher and the video frame looks clearer. Conversely, the blurred video frame has a lower contrast, that is, the sharpness value of the video frame is also lower. The sharpness value calculation can introduce the gradient value as the multiplicative factor of the grayscale image. The calculation formula is as follows:
[0061]
[0062] Among them, i, j represent the pixels in each video frame, m, n are the width and height of each video frame, Δx, Δy are the horizontal and vertical gradients of the pixels, respectively. gray (i, j) is a grayscale video frame, and y2 is the sharpness value of the video frame.
[0063] In order to improve the calculation speed, the calculation formula can be simplified as follows:
[0064]
[0065] The sharpness value y2 can be used to indicate the blurriness of a video frame. The smaller the score, the blurrier the video frame. The score range is [0,1]. The preset sharpness value is a hyperparameter and can be set to 0.1. Each video frame is filtered and video frames with a sharpness value greater than 0.1 are used as key frames of the video clip.
[0066] S203, based on the pre-established annotation tool detection model, perform detection operations on each annotation key frame, determine the target annotation tool based on the annotation tools in each detected annotation key frame, and determine the annotation content and annotation timing corresponding to each target annotation tool.
[0067] Optionally, the annotation tools may include rectangular boxes, arrows, elliptical boxes, etc., and a pre-established detection model may be trained based on the annotation tools such as rectangular boxes, arrows, elliptical boxes, etc. to generate an annotation tool detection model for detecting the annotation tools. Based on the annotation tool detection model, a detection operation is performed on each determined annotation key frame. Based on the detected annotation tools, a pre-set annotation tool that needs to be reflected in the annotation specification is determined as a target annotation tool. Correspondingly, the annotation content and annotation timing corresponding to each target annotation tool in each video frame are determined.
[0068] Optionally, based on the annotation tools detected in each annotation keyframe, determining the target annotation tool includes: inputting the detected annotation tools into a pre-established event filter for filtering target events to filter out the annotation tools corresponding to the target events; and determining the annotation tools corresponding to the target events as the target annotation tools. Specifically, the pre-established event filter is used to filter out the annotation tools corresponding to the target events that need to be paid attention to, thereby determining the annotation tools corresponding to the target time as the target annotation tool.
[0069] S204 , generating a current template sentence pattern matching the current annotation key frame based on the annotation content and the annotation timing, and generating an annotation specification based on each annotation key frame and the template sentence pattern matching the annotation key frame.
[0070] Optionally, the step content of the current template sentence matching the current annotated keyframe may be generated based on the annotation content, and the step count of the current template sentence may be generated based on the annotation timing, and the current template sentence is composed of the step count and the step content.
[0071] The embodiment of the present invention uses the target video of the highest-scoring annotator as the object for generating annotation specifications, thereby improving the effectiveness of the annotation specifications; and filters out blurred or low-brightness video frames to ensure the clarity of the annotation specifications. The entire process does not require human intervention, thereby improving the accuracy of the annotation specification generation process and avoiding unnecessary waste of human and time resources.
[0072] Embodiment 3
[0073] The embodiments corresponding to the annotation specification generation method are described in detail above. In order to make the technical scheme of the method further clear to those skilled in the art, a specific application scenario is given below.
[0074] Figure 3 A schematic diagram of a method for generating a label specification in an application scenario provided by an embodiment of the present invention, such as Figure 3As shown in the figure, after the annotation specification starts to be generated, the annotators are scored according to their annotation results, and the annotated video containing the target medical annotation process annotated by the annotator with the highest annotation score is used as the target video. The video stream of the target video is input for shot segmentation, and the required key video segments are selected from the several video segments obtained after segmentation. The annotation content and annotation timing of each video frame of each video segment are identified, and the timing of the annotation steps is determined based on the annotation timing to generate the template sentence corresponding to the video frame.
[0075] Optionally, the target medical annotation process is parsed into annotation steps 1-10 to obtain the time points of different annotation actions and events. For example, in the 1st to 2nd minute of opening the task, the annotator makes the window adjustment action, and around the 5th minute, the operation of marking the lesion with a box is performed. The events in the target medical annotation process are taken as the basic unit, the precise event occurrence time is retained, and modeling is performed to retain and reflect the relationship between the various events and the frequency structure of different events to the greatest extent.
[0076] The annotation process is converted into time signal data and input into the pre-established CNN training model, LSTM training model and event filter. The annotation process is parsed into specific steps to perform optimal filtering of events and annotation steps. The event filter is used to filter the events that need to be paid attention to in this annotation scene. It can be set in advance according to the annotation task, and the underlined types of events. For example, if the text annotation is only entity annotation without relationship annotation, you can only focus on the events corresponding to the action of annotating the entity; in the process of annotating images, the task is only to detect and draw the lesion location with a box, and other actions of the annotator such as polygon segmentation are filtered out.
[0077] Specifically, the time signal data corresponding to its different steps. The event Xt = (type, time) at time point t encodes type and value respectively. The type vector is a one-hot vector, which represents the event or step extracted during the annotation process. For example, if there are n steps, step 1 is [1, 0, 0...0], with n-1 zeros, and so on.
[0078] The event filter only allows specific events to enter the neuron, and the phase gate makes the neuron open only in a specific cycle. This ensures that each neuron will only capture the features of a few specific types of events and sample them, solving the problem of poor training results caused by the complexity and diversity of time and the long sequence of medical events. The opening and closing of the event gate is controlled by a specific cycle in the phase gate, and the parameters can only be updated when the gate is open. The event filter allows each neuron to focus on a different set of event types, so as to better learn the information in the mixed event sequence.
[0079] The embodiment of the present invention performs human-computer interaction based on the obtained high-quality video frames and the template sentences matched by the corresponding video frames to classify different annotation processes and select the annotation steps and processes with high scores. It can also be used for abnormal annotation action detection, annotation step prediction and prompting, etc.
[0080] Embodiment 4
[0081] Figure 4 This is a structural diagram of a device for generating annotation specifications provided in an embodiment of the present invention, and the device is used to execute the method for generating annotation specifications provided in any of the above embodiments. The device and the method for generating annotation specifications in the above embodiments belong to the same inventive concept, and the details not described in detail in the embodiment of the device for generating annotation specifications can be referred to the embodiment of the method for generating annotation specifications. Figure 4 As shown, the device may specifically include:
[0082] A target video acquisition module 10 is used to acquire a target video including a target medical annotation process and extract annotated key frames in the target video;
[0083] A determination module 11 is used to determine a target annotation tool in each of the annotation key frames, and to determine the annotation content and annotation timing corresponding to each of the target annotation tools;
[0084] The annotation specification generating module 12 is used to generate a current template sentence matching the current annotation key frame based on the annotation content and the annotation timing, and to generate an annotation specification based on each of the annotation key frames and the template sentence matching the annotation key frames.
[0085] Optionally, the determining module 11 includes:
[0086] The detection unit is used to perform a detection operation on each of the annotation key frames based on a pre-established annotation tool detection model; and determine the target annotation tool based on the annotation tools detected in each of the annotation key frames.
[0087] Optionally, the detection unit comprises:
[0088] A filtering unit is used to input the detected marking tool into a pre-established event filter for filtering target events to filter out the marking tools corresponding to the target events; and determine the marking tool corresponding to the target event as the target marking tool.
[0089] Optionally, the target video acquisition module 10 includes:
[0090] A calculation unit is used to obtain each video containing a target medical annotation process and the annotators corresponding to each video; based on the annotation time, annotation pass rate and annotation rejection rate of the annotators, the annotation score of each annotator is calculated; and the video annotated by the annotator with the highest annotation score is determined as the target video.
[0091] Optionally, the target video acquisition module 10 includes:
[0092] The segmentation unit is used to perform a shot segmentation operation on the target video to generate at least two video segments; extract key frames from each of the video segments, and use the key frames corresponding to each of the video segments as the marked key frames of the target video.
[0093] Optionally, the segmentation unit includes:
[0094] The brightness value determining unit is used to determine the brightness value of each video frame in each of the video clips, and determine each video frame whose brightness value is greater than a preset threshold; based on each video frame whose brightness value is greater than the preset threshold, determine the key frame in each of the video clips.
[0095] Optionally, determining the brightness value unit includes:
[0096] A sharpness value determination unit is used to convert each video frame whose brightness is greater than the preset threshold into a grayscale video frame; calculate the sharpness value of each grayscale video frame; and determine each video frame corresponding to each grayscale video frame whose sharpness value is greater than the preset sharpness value as the key frame of the video clip.
[0097] The annotation specification generating device provided in the embodiment of the present invention can execute the annotation specification generating method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.
[0098] It is worth noting that in the embodiment of the above-mentioned annotation specification generating device, the various units and modules included are only divided according to functional logic, but are not limited to the above-mentioned division, as long as the corresponding functions can be realized; in addition, the specific names of the functional units are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of the present invention.
[0099] Embodiment 5
[0100] Figure 5 A structural diagram of an electronic device provided by an embodiment of the present invention. Figure 5 A block diagram of an exemplary electronic device 20 suitable for implementing an embodiment of the present invention is shown. The electronic device 20 shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.
[0101] like Figure 5 As shown, the electronic device 20 is in the form of a general computing device. The components of the electronic device 20 may include but are not limited to: one or more processors or processing units 201, a system memory 202, and a bus 203 connecting different system components (including the system memory 202 and the processing unit 201).
[0102] Bus 203 represents one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, a processor or a local bus using any of a variety of bus structures. For example, these architectures include but are not limited to Industry Standard Architecture (ISA) bus, Micro Channel Architecture (MAC) bus, Enhanced ISA bus, Video Electronics Standards Association (VESA) local bus and Peripheral Component Interconnect (PCI) bus.
[0103] The electronic device 20 typically includes a variety of computer system readable media. These media can be any available media that can be accessed by the electronic device 20, including volatile and non-volatile media, removable and non-removable media.
[0104] The system memory 202 may include computer system readable media in the form of volatile memory, such as random access memory (RAM) 204 and / or cache memory 205. The electronic device 20 may further include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, the storage system 206 may be used to read and write non-removable, non-volatile magnetic media. A disk drive for reading and writing removable non-volatile disks (such as "floppy disks"), and an optical disk drive for reading and writing removable non-volatile optical disks (such as CD-ROM, DVD-ROM or other optical media) may be provided. In these cases, each drive may be connected to the bus 203 via one or more data medium interfaces. The memory 202 may include at least one program product having a set (e.g., at least one) of program modules that are configured to perform the functions of various embodiments of the present invention.
[0105] A program / utility 208 having a set (at least one) of program modules 207 may be stored, for example, in the memory 202, such program modules 207 including but not limited to an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment. The program modules 207 generally perform the functions and / or methods of the embodiments described herein.
[0106] The electronic device 20 may also communicate with one or more external devices 209 (e.g., keyboards, pointing devices, displays 210, etc.), may communicate with one or more devices that enable a user to interact with the electronic device 20, and / or may communicate with any device that enables the electronic device 20 to communicate with one or more other computing devices (e.g., network cards, modems, etc.). Such communication may be performed via an input / output (I / O) interface 211. Furthermore, the electronic device 20 may also communicate with one or more networks (e.g., local area networks (LANs), wide area networks (WANs), and / or public networks, such as the Internet) via a network adapter 212. As shown, the network adapter 212 communicates with other modules of the electronic device 20 via a bus 203. It should be understood that other hardware and / or software modules may be used in conjunction with the electronic device 20, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, etc.
[0107] The processing unit 201 executes various functional applications and data processing by running programs stored in the system memory 202 .
[0108] An electronic device provided by the present invention can implement the following method: obtaining a target video including a target medical annotation process, extracting the annotation key frames in the target video, and reflecting the target medical annotation process through the annotation key frames. Determine the target annotation tool in each annotation key frame, determine the annotation content and annotation timing corresponding to each target annotation tool; generate a current template sentence matching the current annotation key frame based on the annotation content and annotation timing, and generate an annotation specification based on each annotation key frame and the template sentence matching the annotation key frame. It can be seen that the template sentence is obtained by determining the annotation content and annotation timing corresponding to the target annotation tool in each annotation key frame, and the template sentence and each annotation key frame can be used to form an annotation specification. The entire process does not require manual operation, which improves the accuracy of the annotation specification generation process and avoids unnecessary waste of human resources and time resources.
[0109] Embodiment 6
[0110] An embodiment of the present invention provides a storage medium containing computer executable instructions, wherein the computer executable instructions are used to execute a method for generating a labeling specification when executed by a computer processor, the method comprising:
[0111] Obtain a target video containing a target medical annotation process, extract the annotation keyframes in the target video, and reflect the target medical annotation process through the annotation keyframes. Determine the target annotation tool in each annotation keyframe, determine the annotation content and annotation timing corresponding to each target annotation tool; generate a current template sentence matching the current annotation keyframe based on the annotation content and annotation timing, and generate an annotation specification based on each annotation keyframe and the template sentence matching the annotation keyframe. It can be seen that the template sentence is obtained by determining the annotation content and annotation timing corresponding to the target annotation tool in each annotation keyframe, and the template sentence and each annotation keyframe can form an annotation specification. The entire process does not require manual participation, which improves the accuracy of the annotation specification generation process and avoids unnecessary waste of human resources and time resources.
[0112] Of course, the computer executable instructions of a storage medium including computer executable instructions provided in an embodiment of the present invention are not limited to the operations of the method described above, but can also execute related operations in the annotation specification generation method provided in any embodiment of the present invention.
[0113] The computer storage medium of the embodiment of the present invention can adopt any combination of one or more computer-readable media. The computer-readable medium can be a computer-readable signal medium or a computer-readable storage medium. The computer-readable storage medium can be, for example, but not limited to, a system, device or device of electricity, magnetism, light, electromagnetic, infrared, or semiconductor, or any combination of the above. More specific examples (non-exhaustive list) of computer-readable storage media include: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this document, a computer-readable storage medium can be any tangible medium containing or storing a program, which can be used by an instruction execution system, a device or a device or used in combination with it.
[0114] Computer-readable signal media may include data signals propagated in baseband or as part of a carrier wave, which carry computer-readable program code. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.
[0115] Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
[0116] Computer program code for performing the operation of embodiments of the present invention may be written in one or more programming languages or a combination thereof, including object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on a user's computer, partially on a user's computer, as an independent software package, partially on a user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0117] Note that the above are only preferred embodiments of the present invention and the technical principles used. Those skilled in the art will understand that the present invention is not limited to the specific embodiments described herein, and that various obvious changes, readjustments and substitutions can be made by those skilled in the art without departing from the scope of protection of the present invention. Therefore, although the present invention has been described in more detail through the above embodiments, the present invention is not limited to the above embodiments, and may include more other equivalent embodiments without departing from the concept of the present invention, and the scope of the present invention is determined by the scope of the appended claims.
Claims
1. A method for generating a labeling specification, characterized in that: include: Acquire a target video including a target medical annotation process, and extract annotated key frames in the target video; Based on a pre-established annotation tool detection model, a detection operation is performed on each of the annotation key frames, the detected annotation tools are input into a pre-established event filter for filtering target events to filter out the annotation tools corresponding to the target events, the annotation tools corresponding to the target events are determined as target annotation tools, and the annotation content and annotation timing corresponding to each of the target annotation tools are determined; wherein the target annotation tools include rectangular boxes, arrows, elliptical boxes, and magnified spherical cursors; and the annotation timing is determined based on the annotation time of the target annotation tools; A current template sentence matching the current annotation key frame is generated based on the annotation content and the annotation timing, and an annotation specification is generated based on each of the annotation key frames and the template sentence matching the annotation key frames.
2. The method according to claim 1, characterized in that The step of obtaining a target video including a target medical annotation process includes: Obtaining each video including the target medical annotation process and the annotator corresponding to each video; Calculate the annotation score of each annotator based on the annotation time, annotation pass rate and annotation rejection rate of the annotators; The video annotated by the annotator with the highest annotation score is determined as the target video.
3. The method according to claim 1, characterized in that The extracting the marked key frames in the target video includes: Performing a shot segmentation operation on the target video to generate at least two video segments; The key frames in each of the video clips are extracted, and the key frames corresponding to each of the video clips are used as the marked key frames of the target video.
4. The method according to claim 3, characterized in that The step of extracting key frames from each of the video clips comprises: Determine the brightness value of each video frame in each of the video clips, and determine each video frame whose brightness value is greater than a preset threshold; Based on each video frame whose brightness value is greater than the preset threshold, the key frame in each video segment is determined.
5. The method according to claim 4, characterized in that The determining the key frame in each of the video segments based on each of the video frames whose brightness value is greater than the preset threshold comprises: Convert each video frame whose brightness is greater than the preset threshold into a grayscale video frame; Calculating the sharpness value of each of the grayscale video frames; The video frames corresponding to the grayscale video frames whose sharpness values are greater than the preset sharpness value are determined as the key frames of the video clip.
6. A device for generating a labeling specification, characterized in that: include: A target video acquisition module is used to acquire a target video including a target medical annotation process and extract annotated key frames in the target video; A determination module, for performing a detection operation on each of the annotation key frames based on a pre-established annotation tool detection model, inputting the detected annotation tools into a pre-established event filter for filtering target events to filter out the annotation tools corresponding to the target events, determining the annotation tools corresponding to the target events as target annotation tools, and determining the annotation content and annotation timing corresponding to each of the target annotation tools; wherein the target annotation tools include rectangular boxes, arrows, elliptical boxes, and magnified spherical cursors; and the annotation timing is determined based on the annotation time of the target annotation tools; The module for generating annotation specifications is used to generate a current template sentence matching the current annotation key frame based on the annotation content and the annotation timing, and to generate annotation specifications based on each of the annotation key frames and the template sentence matching the annotation key frames.
7. An electronic device, characterized in that: include: one or more processors; A memory for storing one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the annotation specification generating method as described in any one of claims 1-5.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method for generating a labeling specification as described in any one of claims 1 to 5 is implemented.
Citation Information
Patent Citations
Key-frame extraction from video
CN101443850A
Method for video labeling and device for video labeling
CN103065300A
Video frame information labeling method and device, equipment and storage medium
CN110503074A
Target labeling method and device
CN110705405A
Speech skill generation method, artificial intelligence-based interpretation method and devices
CN110990550A
