Image processing method, device and computer readable storage medium
By iteratively expanding the annotation points in the image, the problem of inaccurate image segmentation caused by the clustering method is solved and a more accurate image segmentation effect is achieved.
Patent Information
- Application Number
- CN202010419309.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-05-18
- Publication Date
- 2024-10-22
- Estimated Expiration
- 2040-05-18
AI Technical Summary
In the existing technology, when clustering methods are used for image segmentation, the results have a greater impact on the segmentation effect of the image segmentation model. In order to ensure the accuracy of clustering, the segmentation results are usually smaller than the real objects, resulting in inaccurate segmentation.
By iteratively expanding each annotation point in the image to be processed, an iterative expansion area is formed, and the number of iterations is adjusted according to the size of the object to be segmented to accurately segment the object to be segmented.
It is realized that the number of iterations is adjusted according to the size of the object to be segmented in the image to be processed, so that the iterative expansion area is closer to the actual object size, thereby accurately segmenting the object to be segmented.
Smart Images

Figure CN111598899B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of Internet technology, and relate to but are not limited to an image processing method, device, and computer-readable storage medium. Background Art
[0002] In the field of image processing, it is usually necessary to perform image segmentation processing on images to be processed, such as pathological images or geographic images collected by satellites, in order to segment the objects to be segmented in the images to be processed (such as cells in pathological images or buildings in geographic images, etc.). Recently, deep learning has been widely used in tasks such as image detection and segmentation. Deep learning methods usually need to accurately outline the boundaries of the objects to be segmented so that the model can obtain better image detection and segmentation results.
[0003] In the related art, a clustering method is usually used to expand manual point annotations into pixel-level annotations, and the clustering results are used as positive sample annotations to train an image segmentation model to segment the image to be processed.
[0004] However, the clustering result has a great influence on the segmentation effect of the image segmentation model. Usually, in order to ensure the accuracy of clustering, the image segmentation result will be smaller than the actual object to be segmented in the processed image. Therefore, the clustering method in the related technology cannot accurately segment the image. Summary of the invention
[0005] The embodiments of the present application provide an image processing method, device and computer-readable storage medium, which iteratively expand each annotation point in the image to be processed to form an iterative expansion area corresponding to the annotation point. In this way, the number of iterations can be adjusted according to the difference in the size of the object to be segmented in the image to be processed, so as to accurately segment the object to be segmented.
[0006] The technical solution of the embodiment of the present application is implemented as follows:
[0007] The present application provides an image processing method, including:
[0008] Acquire an image to be processed having at least two divided regions, each of the divided regions including a marked point;
[0009] Iteratively expanding each of the marked points in the image to be processed to obtain an iteratively expanded region corresponding to the marked point;
[0010] respectively determining a first loss result between the iteratively expanded region and the divided region, and a second loss result between the iteratively expanded region and the marked point;
[0011] When the first loss result and the second loss result meet the iteration termination condition, stopping the iterative expansion of the corresponding marked point;
[0012] The iterative expansion region obtained when the iterative expansion is stopped is determined as the region where the object to be segmented in the image to be processed is located.
[0013] The present application provides an image processing method, including:
[0014] Acquire a pathological image having at least two divided regions, each of the divided regions includes a marked point, and each of the marked points corresponds to a cell;
[0015] Iteratively expanding each of the annotated points in the pathological image to obtain an iteratively expanded region corresponding to the annotated point;
[0016] respectively determining a first loss result between the iteratively expanded region and the divided region, and a second loss result between the iteratively expanded region and the marked point;
[0017] When the first loss result and the second loss result satisfy an iteration termination condition, stopping the iterative expansion of the marked point;
[0018] The iterative expansion region obtained when the iterative expansion is stopped is determined as the region where the cells in the pathological image are located.
[0019] The present application provides an image processing method, including:
[0020] In response to a click operation by the user, displaying an image to be processed corresponding to the click operation on a current interface of the terminal;
[0021] In response to a trigger operation by the user, the image processing step is triggered to implement the image processing process of the image to be processed, form a segmented image, and display the segmented image on the current interface.
[0022] The present application provides an image processing device, including:
[0023] An acquisition module, used for acquiring an image to be processed having at least two divided areas, each of the divided areas including a marked point;
[0024] An iterative expansion module, used for iteratively expanding each of the annotation points in the image to be processed to obtain an iterative expansion region corresponding to the annotation point;
[0025] A first determination module, used to respectively determine a first loss result between the iteratively expanded area and the divided area, and a second loss result between the iteratively expanded area and the marked point;
[0026] A control module, configured to stop iterative expansion of corresponding annotation points when the first loss result and the second loss result meet an iteration termination condition;
[0027] The second determination module is used to determine the iterative expansion area obtained when the iterative expansion is stopped as the area where the object to be segmented in the image to be processed is located.
[0028] The present application provides an image processing device, including:
[0029] The memory is used to store executable instructions; the processor is used to implement the above method when executing the executable instructions stored in the memory.
[0030] An embodiment of the present application provides a computer-readable storage medium storing executable instructions for causing a processor to execute and implement the above method.
[0031] The embodiments of the present application have the following beneficial effects:
[0032] An image to be processed having at least two divided regions is obtained, and each annotated point in the image to be processed is iteratively expanded to form an iteratively expanded region corresponding to the annotated point. Finally, the timing of stopping the iteration is determined according to the first loss result and the second loss result between the iteratively expanded region and the divided region and the annotated point, respectively. In this way, the number of iterations can be adjusted according to the difference in the size of the object to be segmented in the image to be processed. Through multiple iterative expansions, the size of the iteratively expanded region formed is closer to the size of the object to be segmented, so that the object to be segmented can be accurately segmented. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] Figure 1 It is a flowchart of an image processing method in the related art;
[0034] Figure 2A is an optional architecture diagram of the image processing system 10 provided in an embodiment of the present application;
[0035] Figure 2B This is an optional structural diagram of the image processing system 10 provided in the embodiment of the present application applied to a blockchain system;
[0036] Figure 2C It is an optional schematic diagram of a block structure provided in an embodiment of the present application;
[0037] Figure 3 is a schematic diagram of the structure of the server 300 provided in an embodiment of the present application;
[0038] Figure 4It is an optional flowchart of the image processing method provided in the embodiment of the present application;
[0039] Figure 5 It is an optional flowchart of the image processing method provided in the embodiment of the present application;
[0040] Figure 6 It is an optional flowchart of the image processing method provided in the embodiment of the present application;
[0041] Figure 7 It is a schematic diagram of an optional training process of the image segmentation model provided in the embodiment of the present application;
[0042] Figure 8 It is a schematic diagram of a product-side application scenario provided by an embodiment of the present application;
[0043] Fig. 9 It is an optional flowchart of the image processing method provided in the embodiment of the present application;
[0044] Fig.10 It is the image to be processed after manual point annotation provided in the embodiment of the present application;
[0045] Fig.11 is a schematic diagram of a Voronoi partitioned image provided in an embodiment of the present application;
[0046] Fig.12 is a schematic diagram of the iterative process of cell point annotation provided in an embodiment of the present application;
[0047] Figures 13A to 13C It is a schematic diagram of the results of processing various types of pathological images using the cell segmentation model of an embodiment of the present application. DETAILED DESCRIPTION
[0048] In order to make the purpose, technical solutions and advantages of the present application clearer, the present application will be further described in detail below in conjunction with the accompanying drawings. The described embodiments should not be regarded as limiting the present application. All other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of this application.
[0049] In the following description, reference is made to "some embodiments", which describe a subset of all possible embodiments, but it is understood that "some embodiments" may be the same subset or different subsets of all possible embodiments, and may be combined with each other without conflict. Unless otherwise defined, all technical and scientific terms used in the embodiments of the present application have the same meaning as those commonly understood by those skilled in the art of the technical field of the embodiments of the present application. The terms used in the embodiments of the present application are only for the purpose of describing the embodiments of the present application and are not intended to limit the present application.
[0050] In order to better understand the image processing method provided in the embodiment of the present application, the image processing method in the related art is first described. In the following description of the related technical solution and the solution of the present application, pathological images can be used as images to be processed and cells can be used as objects to be segmented for illustration:
[0051] Pathology is the microscopic study of cell morphology, which can complement in situ molecular information. In the process of pathology research, tissue samples are usually removed from the body and then placed in a fixative to make pathological sections for observation under a microscope. The fixative is used to stabilize the tissue to prevent decay. In order to observe under a microscope, different components of the tissue are stained with different stains, and then different staining techniques are applied to show specific tissue components under the microscope.
[0052] Usually, cells in pathological sections are an important basis for judgment, so many tasks require cell detection and segmentation. Recently, deep learning has been widely used in tasks such as cell detection and segmentation. Deep learning methods usually need to accurately outline the boundaries of cells so that the model can obtain better cell detection and segmentation results. This kind of pixel-level annotation data requires a lot of time and manpower, so simply annotating a point for each cell becomes a feasible alternative annotation solution, which can greatly reduce the workload of annotation.
[0053] In the related art, clustering methods are usually used to expand manual point annotations to pixel-level annotations, and point annotations are used to generate Voronoi polygons. The clustering results are then used as positive sample annotations, and the boundaries of the Voronoi polygons are used as negative sample annotations to train the model, and the cells are segmented using the trained model. Figure 1 FIG. 1 is a flow chart of an image processing method in the related art, and the method includes the following steps:
[0054] Step S101, manually marking the pathological image.
[0055] Here, a drawing tool or other annotation tools can be used to manually mark each cell with a annotation point.
[0056] Step S102, performing cell clustering processing on the pathological image to obtain a clustered image.
[0057] Here, the pathological images are clustered using a clustering method with manually annotated points as seed points to obtain cell clustering results as pixel-level annotations of cells.
[0058] Step S103, performing Voronoi division on the manual point annotations.
[0059] Here, the Voronoi partitioning is performed on the manual point annotations to obtain the Voronoi partitioning boundary as the background annotation image.
[0060] Step S104, using the point annotations as the cell annotation image and the Voronoi division boundary as the background annotation image, and training to obtain a cell segmentation model.
[0061] The cell segmentation method based on clustering method in the related art mainly has the following disadvantages:
[0062] 1) The clustering results of cells are used as pixel-level annotations of cells. The model training results depend to a large extent on the accuracy of the clustering method, and the model training results are sensitive to the clustering parameters.
[0063] 2) In order to ensure the correctness of the cell clustering process, the result of the cell clustering process will be smaller than the real cell, so the final segmented cell result will be smaller than the real cell.
[0064] Based on at least one of the above problems in the related art, an embodiment of the present application provides an image processing method, first, obtaining an image to be processed having at least two divided areas, each divided area includes a marked point, and each marked point corresponds to an object to be segmented; then, each marked point in the image to be processed is iteratively expanded to obtain an iterative expansion area corresponding to the marked point, and a first loss result between the iterative expansion area and the divided area, and a second loss result between the iterative expansion area and the marked point are determined respectively; finally, when the first loss result and the second loss result meet the iteration termination condition, the iterative expansion of the corresponding marked point is stopped; the iterative expansion area obtained when the iterative expansion is stopped is determined as the area where the object to be segmented in the image to be processed is located. In this way, since the number of iterations can be adjusted according to the difference in the size of the object to be segmented in the image to be processed, through multiple iterative expansions, the size of the iterative expansion area formed will be closer to the size of the object to be segmented, so that the object to be segmented can be accurately segmented. In addition, the method of the embodiment of the present application can also be implemented based on artificial intelligence (AI, Artificial Intelligence) technology.
[0065] The following is a brief introduction to artificial intelligence technology:
[0066] Artificial intelligence is the theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results. In other words, artificial intelligence is a comprehensive technology in computer science that attempts to understand the essence of intelligence and produce a new intelligent machine that can respond in a similar way to human intelligence. Artificial intelligence is to study the design principles and implementation methods of various intelligent machines so that the machines have the functions of perception, reasoning and decision-making. In the embodiment of the present application, image segmentation processing can be implemented based on artificial intelligence technology, that is, artificial intelligence technology is used to determine the segmentation line of the image to be segmented, thereby realizing the segmentation processing of the image to be segmented, or, image segmentation model training based on artificial intelligence, that is, artificial intelligence technology is used to implement the training of the image segmentation model.
[0067] Artificial intelligence technology is a comprehensive discipline that covers a wide range of fields, including both hardware-level and software-level technologies. Basic artificial intelligence technologies generally include technologies such as sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, big data processing technology, operation / interaction systems, and mechatronics. For example, when artificial intelligence technology is used to implement the image processing method of the embodiment of the present application, an artificial intelligence chip can be used to perform a series of calculations and processing to obtain the segmentation line of the image to be segmented. Artificial intelligence software technology mainly includes computer vision technology, speech processing technology, natural language processing technology, and machine learning / deep learning. Among them, computer vision technology (CV, Computer Vision) is a science that studies how to make machines "see". To put it more concretely, it refers to machine vision such as using cameras and computers to replace human eyes to identify, track and measure targets, and further perform graphics processing to make computer processing more suitable for human eye observation or transmission to instrument detection. As a scientific discipline, computer vision studies related theories and technologies, attempting to establish an artificial intelligence system that can obtain information from images or multidimensional data. Computer vision technology generally includes image processing, image recognition, image semantic understanding, image retrieval, OCR, video processing, video semantic understanding, video content / behavior recognition, three-dimensional object reconstruction, 3D technology, virtual reality, augmented reality, simultaneous positioning and map construction, as well as common biometric recognition technologies such as face recognition and fingerprint recognition.
[0068] With the research and advancement of artificial intelligence technology, artificial intelligence technology has been studied and applied in many fields, such as common smart homes, smart wearable devices, virtual assistants, smart speakers, smart marketing, unmanned driving, automatic driving, drones, robots, smart medical care, smart customer service, etc. I believe that with the development of technology, artificial intelligence technology will be applied in more fields and play an increasingly important role.
[0069] The method provided in the embodiment of the present application relates to an image segmentation processing technology of artificial intelligence, which can combine the computer vision technology in the artificial intelligence technology with the full convolutional neural network to divide the image to be processed to form at least two divided areas, each of which includes a marked point; and iteratively expand each marked point in the image to be processed to form an iterative expansion area corresponding to the marked point; finally, when the iterative expansion area satisfies the iteration termination condition with the first loss result and the second loss result between the divided area and the marked point respectively, the iterative expansion of the marked point is stopped; and according to the iterative expansion area obtained when the iterative expansion is stopped, the area where the object to be segmented in the image to be processed is located is determined, thereby completing the segmentation processing of the object to be segmented in the image to be processed. In other embodiments, the image after segmentation processing can also be further processed based on artificial intelligence technology, for example, the image after segmentation processing is subjected to color conversion or coloring, etc., to obtain a processed image that meets user needs. In some other embodiments, artificial intelligence technology can also be combined with image segmentation model training technology to realize the image segmentation model training process based on artificial intelligence. The above-mentioned processing method based on artificial intelligence will be described in subsequent embodiments.
[0070] The following describes an exemplary application of the image processing device provided by the embodiment of the present application. The image processing device provided by the embodiment of the present application can be implemented as any terminal with a screen display function, such as a laptop computer, a tablet computer, a desktop computer, a mobile device (for example, a mobile phone, a portable music player, a personal digital assistant, a dedicated messaging device, a portable gaming device), an intelligent robot, etc., and can also be implemented as a server. The following describes an exemplary application when the image processing device is implemented as a server.
[0071] See also Figure 2A , Figure 2A1 is an optional architecture diagram of the image processing system 10 provided in the embodiment of the present application. To support an image processing application, so as to implement the segmentation processing of the image to be processed and the image processing steps after the segmentation, the image processing system 10 includes a terminal 100, a network 200 and a server 300. Among them, an image processing application is run on the terminal 100. When implementing the image processing method of the embodiment of the present application, the acquisition unit of the terminal 100 acquires the image to be processed; and obtains the manual annotation of the image to be processed by the user to obtain at least two annotation points, each of which corresponds to an object to be segmented, and sends the image to be processed with at least two annotation points to the server 300 through the network 200; the server 300 divides the image to be processed to form at least two divided areas; and iteratively expands each annotation point in the image to be processed to form an iterative expansion area corresponding to the annotation point; when the iterative expansion area meets the first loss result and the second loss result between the divided area and the annotation point, respectively, the iterative expansion of the annotation point is stopped; at the same time, the iterative expansion area obtained when the iterative expansion is stopped is determined as the area where the object to be segmented in the image to be processed is located. Finally, according to the determined area where the object to be segmented is located, the image to be processed is segmented to obtain an image after segmentation (i.e., a segmented image), and the segmented image is returned to the terminal 100 through the network 200; the terminal 100 can display the segmented image on the current interface 100-1. Alternatively, in other embodiments, the server 300 can further process the segmented image, such as performing a color change on the segmented image, i.e., performing a color change on the area where the object to be segmented is located, and then sending the color-changed image to the terminal 100 through the network 200, so that the terminal 100 can display the color-changed image on the current interface 100-1.
[0072] In some embodiments, after forming the segmented image, the server 300 can also feed back the segmented image to the terminal 100 through the network 200; after the terminal 100 obtains the segmented image, the image to be processed and the segmented image can be simultaneously displayed on the current interface 100-1 for user viewing and operation, or only the segmented image can be displayed.
[0073] In some embodiments, the image processing system 10 may further include a terminal 101, which may be the same terminal as the terminal 100 or a different terminal. Figure 2A, wherein the terminal 100 is used to provide the image to be processed to the server, and the terminal 101 is used to display the segmented image on the current interface 101-1. For example, the image to be processed may be a pathological image of a hospital, and the terminal 100 is a medical imaging device used to collect the pathological image of the patient. After the terminal 100 collects the pathological image, the pathological image is sent to the server 300 for segmentation processing to obtain a segmented image; after obtaining the segmented image, the server sends the segmented image to the doctor's computer, that is, to the terminal 101, so that the doctor can view the segmented image on the terminal 101 and perform pathological analysis based on the segmented image.
[0074] The image processing system 10 involved in the embodiment of the present application may also be a distributed system 201 of a blockchain system, see Figure 2B , Figure 2B It is an optional structural diagram of the image processing system 10 provided in the embodiment of the present application applied to the blockchain system, wherein the distributed system 201 can be a distributed node formed by multiple nodes 202 (any form of computing devices in the access network, such as servers, user terminals) and clients 203, and the nodes form a peer-to-peer (P2P, Peer To Peer) network, and the P2P protocol is an application layer protocol running on the Transmission Control Protocol (TCP, Transmission Control Protocol) protocol. In a distributed system, any machine such as a server or a terminal can join and become a node, and the node includes a hardware layer, an intermediate layer, an operating system layer, and an application layer.
[0075] It should be noted that in the distributed system 201, each node 202 corresponds to a terminal 100. On each terminal 100, the patient's pathological image and the segmented image corresponding to the pathological image will be collected, and based on the doctor's analysis of the pathological image, the terminal 100 will also collect the symptom analysis corresponding to the patient's pathological image, that is, the corresponding relationship between the pathological image and the symptom analysis is collected and stored in the blockchain system. By collecting the corresponding relationship between these pathological images and symptom analysis and storing these data on the chain, it is convenient to conduct rapid pathological analysis based on the data stored on the blockchain for the same pathological image in the future, or it can ensure that the physical condition of the same patient is accurately recorded in real time, so as to facilitate the early discovery of physical health problems and provide accurate clinical basis for the treatment of the patient's disease.
[0076] In the embodiment of the present application, in the blockchain system, the images to be processed and the images after segmentation processing on each terminal 100 will be recorded and cannot be changed. Moreover, as the terminal 100 further receives images to be processed and the images after segmentation processing about the same patient or about patients with the same type of disease, there will be data updates. Then, the data stored in the blockchain will also be updated. Therefore, the images to be processed and the images after segmentation processing can be updated in a timely manner.
[0077] See also Figure 2B The functions of each node in the blockchain system are shown in the figure. The functions involved in each node in the blockchain system are described in detail below:
[0078] 1) Routing, a basic function of a node, is used to support communication between nodes. In addition to the routing function, a node can also have the following functions:
[0079] 2) Applications, which are deployed in the blockchain to implement specific services according to actual business needs, record data related to the implementation of functions to form record data, carry digital signatures in the record data to indicate the source of the task data, and send the record data to other nodes in the blockchain system for other nodes to add the record data to the temporary block when they successfully verify the source and integrity of the record data. For example, the services implemented by the application include: 2.1) Wallets, which are used to provide the function of conducting electronic currency transactions, including initiating transactions (i.e., sending the transaction record of the current transaction to other nodes in the blockchain system. After other nodes successfully verify, as a response to acknowledging the validity of the transaction, the record data of the transaction is stored in the temporary block of the blockchain; of course, the wallet also supports querying the remaining electronic currency in the electronic currency address. 2.2) Shared ledgers, which are used to provide functions such as storage, query and modification of account data, and send the record data of the operation on the account data to other nodes in the blockchain system. After other nodes verify the validity, as a response to acknowledging the validity of the account data, the record data is stored in the temporary block, and a confirmation can also be sent to the node that initiated the operation. 2.3) Smart contracts are computerized protocols that can execute the terms of a contract. They are implemented by deploying code on a shared ledger that is executed when certain conditions are met. The code is used to complete automated transactions based on actual business needs, such as querying the logistics status of the goods purchased by the buyer and transferring the buyer's electronic currency to the merchant's address after the buyer signs for the goods. Of course, smart contracts are not limited to executing contracts for transactions, but can also execute contracts for processing received information.
[0080] 3) Blockchain, including a series of blocks that are connected to each other in the order of their generation. Once a new block is added to the blockchain, it will not be removed. The block records the record data submitted by the nodes in the blockchain system.
[0081] 4) Consensus is a process in the blockchain network used to reach agreement on transactions in a block among multiple nodes involved. The agreed blocks will be appended to the end of the blockchain. The mechanisms for achieving consensus include Proof of Work (PoW), Proof of Stake (PoS), Delegated Proof-of-Stake (DPoS), Proof of Elapsed Time (PoET), etc.
[0082] See also Figure 2C , Figure 2C It is an optional schematic diagram of the block structure (Block Structure) provided in the embodiment of the present application. Each block includes the hash value of the transaction record stored in this block (the hash value of this block) and the hash value of the previous block. Each block is connected by the hash value to form a blockchain. In addition, the block can also include information such as the timestamp when the block was generated. Blockchain is essentially a decentralized database, a string of data blocks generated by cryptographic methods. Each data block contains relevant information for verifying the validity of its information (anti-counterfeiting) and generating the next block.
[0083] See also Figure 3 , Figure 3 is a schematic diagram of the structure of the server 300 provided in the embodiment of the present application, Figure 3 The server 300 shown includes: at least one processor 310, a memory 350, at least one network interface 320 and a user interface 330. The various components in the server 300 are coupled together via a bus system 340. It is understood that the bus system 340 is used to achieve connection and communication between these components. In addition to the data bus, the bus system 340 also includes a power bus, a control bus and a status signal bus. However, for the sake of clarity, the bus system 340 is not described in detail. Figure 3 Various buses are labeled as bus system 340 .
[0084] The processor 310 can be an integrated circuit chip with signal processing capabilities, such as a general-purpose processor, a digital signal processor (DSP), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc., where the general-purpose processor can be a microprocessor or any conventional processor, etc.
[0085] The user interface 330 includes one or more output devices 331 that enable presentation of media content, including one or more speakers and / or one or more visual display screens. The user interface 330 also includes one or more input devices 332, including user interface components that facilitate user input, such as a keyboard, mouse, microphone, touch screen display, camera, other input buttons and controls.
[0086] The memory 350 may be removable, non-removable or a combination thereof. Exemplary hardware devices include solid-state memory, hard disk drive, optical disk drive, etc. The memory 350 may optionally include one or more storage devices physically away from the processor 310. The memory 350 includes a volatile memory or a non-volatile memory, and may also include both volatile and non-volatile memory. The non-volatile memory may be a read-only memory (ROM), and the volatile memory may be a random access memory (RAM). The memory 350 described in the embodiment of the present application is intended to include any suitable type of memory. In some embodiments, the memory 350 can store data to support various operations, and examples of these data include programs, modules, and data structures or subsets or supersets thereof, as exemplarily described below.
[0087] Operating system 351, including system programs for processing various basic system services and performing hardware-related tasks, such as framework layer, core library layer, driver layer, etc., for implementing various basic services and processing hardware-based tasks;
[0088] A network communication module 352, for reaching other computing devices via one or more (wired or wireless) network interfaces 320, exemplary network interfaces 320 include: Bluetooth, Wireless Compatibility Authentication (WiFi), and Universal Serial Bus (USB);
[0089] The input processing module 353 is used to detect one or more user inputs or interactions from one of the one or more input devices 332 and translate the detected inputs or interactions.
[0090] In some embodiments, the device provided in the embodiments of the present application can be implemented in software. Figure 3An image processing device 354 stored in the memory 350 is shown. The image processing device 354 may be an image processing device in the server 300. The image processing device 354 may be software in the form of a program or a plug-in, and includes the following software modules: an acquisition module 3541, an iterative expansion module 3542, a first determination module 3543, a control module 3544, and a second determination module 3545. These modules are logical, and therefore may be arbitrarily combined or further split according to the functions implemented. The functions of each module will be described below.
[0091] In other embodiments, the device provided in the embodiments of the present application can be implemented in hardware. As an example, the device provided in the embodiments of the present application can be a processor in the form of a hardware decoding processor, which is programmed to execute the image processing method provided in the embodiments of the present application. For example, the processor in the form of a hardware decoding processor can adopt one or more application-specific integrated circuits (ASICs), DSPs, programmable logic devices (PLDs), complex programmable logic devices (CPLDs), field-programmable gate arrays (FPGAs) or other electronic components.
[0092] The image processing method provided by the embodiment of the present application will be described below in conjunction with the exemplary application and implementation of the server 300 provided by the embodiment of the present application. Figure 4 , Figure 4 is an optional flow chart of the image processing method provided in the embodiment of the present application, which will be combined with Figure 4 The steps shown are explained.
[0093] Step S401: Acquire an image to be processed having at least two divided regions.
[0094] Here, the image to be processed has an object to be segmented, the object to be segmented forms the foreground image of the image to be processed, and the other parts of the image to be processed except the object to be segmented form the background image of the image to be processed, and there is a large difference between the foreground image and the background image, that is, the difference between the foreground image and the background image is large. For example, there may be a large color difference, and the color of the foreground image is similar or consistent, and the color of the background image is similar or consistent; or, there may be a large brightness difference between the foreground image and the background image; or, there are multiple objects to be segmented in the foreground image, and the objects to be segmented have similar or identical shapes, or have similar sizes, while the objects in the background image have irregular shapes, or the objects in the background image have large differences in shape and size.
[0095] The image to be processed includes at least two annotation points, which are formed by manual annotation by the user, and each annotation point corresponds to an object to be segmented. The annotation point marks the location of the object to be segmented, and the annotation point is located at the center of the object to be segmented, or the distance between the annotation point and the center of the object to be segmented is less than a threshold.
[0096] In an embodiment of the present application, a drawing tool or other marking tool can be used to manually mark a marking point for each object to be segmented, so as to pre-mark the approximate position of the object to be segmented, and then, based on the pre-marked marking points, the area where the object to be segmented is located is determined.
[0097] Each divided area includes a marked point. In some embodiments, the image to be processed can be divided to form at least two divided areas. Here, the image to be processed can be divided by using the Voronoi division method to divide the image to be processed to form at least two divided areas. Each divided area includes a marked point, so the divided areas are connected to each other to form the above-mentioned image to be processed.
[0098] In the embodiment of the present application, the area of the region where the object to be segmented corresponds to the marked point in each divided area is smaller than the area of the divided area. That is, each divided area includes an object to be segmented, and the divided area is the extreme area of the object to be segmented.
[0099] In an embodiment of the present application, by dividing the divided areas, the iterative process and the termination conditions of the iteration can be constrained during the subsequent iterative expansion to determine the area where the object to be segmented is located, so as to avoid the area where the expanded object to be segmented is larger than the area where the actual object to be segmented is located.
[0100] Step S402, iteratively expand each annotation point in the image to be processed to obtain an iteratively expanded region corresponding to the annotation point.
[0101] Here, iterative expansion refers to cyclically expanding the area of the region where the annotation point is located with the annotation point as the expansion center. In the embodiment of the present application, in each iterative expansion process, the expansion size parameter can be a preset fixed value, or the iterative expansion size parameter can be determined before each iterative expansion, and then the annotation point is iteratively expanded according to the determined size parameter to form an iterative expansion region of the annotation point.
[0102] It should be noted that, in the first iterative expansion process of the marked point, the marked point is used as the expansion center, and the iterative expansion size parameter is used to expand outward once to form an iterative expansion area that wraps the marked point; in the second iterative expansion process, the iterative expansion area formed after the first iterative expansion is used as the starting shape of the expansion, and the boundary of the iterative expansion area formed after the first iterative expansion is expanded outward once according to the iterative expansion size parameter; that is, in the Nth iterative expansion process, the iterative expansion area formed after the N-1th iterative expansion is used as the starting shape of this expansion, and the boundary of the iterative expansion area formed after the N-1th iterative expansion is expanded outward once according to the iterative expansion size parameter, where N is greater than or equal to 1.
[0103] Step S403, respectively determining a first loss result between the iteratively expanded region and the divided region, and a second loss result between the iteratively expanded region and the marked point.
[0104] Here, a first loss result between the iterative expansion region and the divided region, and a second loss result between the iterative expansion region and the marked point can be determined by a preset loss model according to the boundary of the iterative expansion region, the boundary of the divided region, and the position of the marked point. Here, the first loss result and the second loss result are used to characterize the similarity between the first distance between the boundary of the iterative expansion region and the boundary of the divided region, and the first distance between the boundary of the iterative expansion region and the position of the marked point, and the preset first distance and the preset second distance. After determining the first distance and the second distance, the first loss result and the second loss result are determined according to the similarity between the first distance and the second distance and the preset first distance and the preset second distance, respectively.
[0105] Step S404: when the first loss result and the second loss result satisfy the iteration termination condition, stop the iterative expansion of the corresponding annotation point.
[0106] The iteration termination condition is used to determine whether the boundary of the current iterative expansion region is close to the boundary of the region where the actual object to be segmented is located. When the difference between the boundary of the current iterative expansion region and the boundary of the region where the actual object to be segmented is located is less than the threshold, it indicates that the current iterative expansion region can be used to approximate or represent the boundary of the region where the object to be segmented is located. Therefore, the iterative expansion of the annotation points is stopped to avoid the iterative expansion causing the size of the iterative expansion region to be larger than the size of the region where the object to be segmented is located, which causes a large error between the result of the iterative expansion and the actual result of the region where the actual object to be segmented is located.
[0107] Step S405: determining the iterative expansion region obtained when the iterative expansion is stopped as the region where the object to be segmented in the image to be processed is located.
[0108] Here, when it is determined that it is necessary to stop the iterative expansion, the iterative expansion region obtained when the iterative expansion is stopped is determined as the region where the object to be segmented is located, that is, the segmentation region of the image to be processed is determined.
[0109] In some embodiments, after determining the final iterative expansion area, that is, determining the area where the object to be segmented is located, the image to be processed can be segmented according to the iterative expansion area to segment the object to be segmented in the image to be processed and other images except the object to be segmented. In other words, the foreground image and background image of the image to be processed can be segmented separately for subsequent other image processing or image analysis processes.
[0110] The image processing method provided by the embodiment of the present application obtains an image to be processed having at least two divided regions, and iteratively expands each annotation point in the image to be processed to form an iterative expansion region corresponding to the annotation point, and finally determines the timing of stopping the iteration according to the first loss result and the second loss result between the iterative expansion region and the divided region and the annotation point, respectively. In this way, the number of iterations can be adjusted according to the difference in the size of the object to be segmented in the image to be processed, and through multiple iterative expansions, the size of the iterative expansion region formed is closer to the size of the object to be segmented, so that the object to be segmented can be accurately segmented.
[0111] In some embodiments, the image to be processed may have a foreground image and a background image, and the foreground image and the background image are distinct, and the difference between the foreground image and the background image is large, so that they are easy to distinguish. For example, the color difference between the foreground image and the background image in the image to be processed is large, and they are easy to distinguish in color, and the foreground image has a uniform shape, or the foreground image is a large number of objects with similar shapes. For example, the image to be processed may be a pathological image, and correspondingly, the object to be segmented is a cell, or the image to be processed may be a geographic image collected by a satellite, and correspondingly, the object to be segmented is a house or a region.
[0112] The image processing system includes a terminal and a server, wherein the terminal can be any type of terminal, for example, the terminal can be a mobile phone or a camera device with an image acquisition function, or a medical imaging device. The terminal obtains the image to be processed and sends the image to be processed to the server for segmentation processing. Figure 5 is an optional flow chart of the image processing method provided in the embodiment of the present application, such as Figure 5 As shown, the method comprises the following steps:
[0113] Step S501: The terminal collects images to obtain images to be processed.
[0114] Here, the terminal may be provided with an image acquisition device, and images may be acquired through the image acquisition device. Alternatively, the terminal may also download images from the network, or the terminal may also obtain images from a specific data set.
[0115] Step S502: the terminal obtains the user's annotation operation to form at least two annotation points on the image to be processed.
[0116] After the terminal captures the image to be processed, it can display the image to be processed on the current interface, and use a drawing tool or other annotation tools to mark a marking point for each object to be segmented, so as to pre-mark the approximate position of the object to be segmented, forming at least two annotation points on the image to be processed.
[0117] Step S503: the terminal sends an image processing request to the server, where the image processing request includes an image to be processed having at least two annotated points.
[0118] Step S504: the server divides the image to be processed into at least two divided areas, each of which includes one of the marked points.
[0119] Here, step S504 can be implemented by the following steps:
[0120] Step S5041, dividing the image to be processed according to at least two marked points to form at least two divided areas with continuous polygonal shapes. Each two marked points can be connected into a line segment, and the continuous polygon formed by the perpendicular bisector of each line segment is determined as the divided divided area.
[0121] Step S505 : the server iteratively expands each annotation point in the image to be processed to form an iteratively expanded region corresponding to the annotation point.
[0122] Step S506, the server determines the loss result between the iterative expansion area, the divided area and the marked point, wherein the loss result between the iterative expansion area, the divided area and the marked point includes a first loss result between the iterative expansion area and the divided area, and a second loss result between the iterative expansion area and the marked point.
[0123] Step S507, determining whether the loss result satisfies the iteration termination condition.
[0124] When the judgment result is yes, execute step S508; when the judgment result is no, return to continue executing step S505.
[0125] Step S508: The server stops iterative expansion of the annotation points.
[0126] In step S509, the server determines the iterative expansion region obtained when the iterative expansion is stopped as the region where the object to be segmented in the image to be processed is located.
[0127] In some embodiments, when the image to be processed is a pathological image and the object to be segmented is a cell, step S509 may be to determine the iterative expansion region obtained when the iterative expansion is stopped as the region where the cells in the pathological image are located.
[0128] Step S510: the server segments the image to be processed according to the iterative expansion region obtained when the iterative expansion is stopped, to form a segmented image. For example, when the object to be segmented is a cell, the cell can be segmented from the image to be processed.
[0129] Step S511: the server sends the segmented image to the terminal.
[0130] Step S512: the terminal displays the segmented image on the current interface.
[0131] The image processing method provided by the embodiment of the present application collects pathological images through a medical imaging device as a terminal, and sends the collected pathological images to a server for processing, thereby obtaining a segmented image of cells, and realizing image segmentation processing of the pathological images. Since the cells have the same color and similar shapes, the iterative expansion process of the embodiment of the present application can accurately segment the cells in the pathological images. Moreover, through multiple iterative expansions, the size of the iterative expansion area formed is closer to the size of the cells, so that the cells in the pathological images can be accurately segmented.
[0132] In some embodiments, an image processing method is provided, comprising the following steps:
[0133] Step S11, in response to a click operation by the user, displaying an image to be processed corresponding to the click operation on a current interface of the terminal.
[0134] Here, the user's click operation can be a selection operation of the user on the current interface of the terminal, and the user can select an image to be processed on the terminal. After receiving the user's click operation, the terminal displays the selected image to be processed on the current interface.
[0135] Step S12, in response to a trigger operation of the user, triggering an image processing step, implementing an image processing process on the image to be processed, forming a segmented image, and displaying the segmented image on the current interface.
[0136] Here, the trigger operation may be an operation for triggering the terminal to perform image processing. After the user selects the image to be processed, a selection button may be displayed on the current interface of the terminal. The selection button is used to remind the user whether to choose to start image processing, that is, to remind the user whether to perform image segmentation. When the user selects the start button, the trigger operation is executed accordingly. Correspondingly, the terminal triggers the image processing step and sends the image to be processed to the server, so that the server performs segmentation processing on the image to be processed to form a segmented image, and sends the segmented image to the terminal, so that the segmented image is displayed on the current interface of the terminal.
[0137] Figure 6 is an optional flow chart of the image processing method provided in the embodiment of the present application, such as Figure 6 As shown, step S402 can be implemented by the following steps:
[0138] Step S601 , iteratively dilate each annotation point in the image to be processed using an iterative dilation parameter to obtain an iterative dilation region corresponding to the annotation point.
[0139] Here, the iterative expansion parameter is a size parameter used for iterative expansion. In some embodiments, the iterative expansion parameter includes an expansion distance, which refers to the diameter of the outward expansion during each iterative expansion. During the iterative expansion process, the expansion distance of each expansion can be the same or different; the expansion distance of each expansion can be a preset fixed value or a random value determined according to the current iterative expansion area.
[0140] In some embodiments, step S601 may be implemented by the following steps: Step S6011, taking each annotation point as the center and the expansion distance as the radius, iteratively expand each annotation point in the image to be processed to form an iterative expansion region corresponding to the annotation point.
[0141] Please continue to refer to Figure 6 In some embodiments, step S402 may also be implemented by the following steps:
[0142] Step S602 , taking each marked point as the center and a preset expansion distance as the radius, initially expanding each marked point in the image to be processed to form a foreground area having at least two expansion areas.
[0143] Here, the initial expansion refers to the expansion of the annotation points. Since there is no expansion area with a certain area during the initial expansion, a circle can be directly formed according to the annotation points and the preset expansion distance. The circle is the expansion area of the annotation points. After the initial expansion of the annotation points, each annotation point corresponds to a circle, and multiple circles together form a foreground area, where the foreground area refers to the area formed by the expansion area, the foreground area includes the area where the object to be segmented of the image to be processed is located, and the foreground area does not include the area where the background image of the image to be processed is located.
[0144] Step S603 , taking each marked point as the center and the preset expansion distance as the radius, performing at least one iterative expansion on each expansion area in the foreground area to obtain an iterative expansion area corresponding to the marked point.
[0145] Here, after the initial expansion, an expansion region of the initial expansion is formed. In the subsequent iterative expansion process, the boundary of the expansion region can be used as the expansion starting position to perform at least one iterative expansion on the expansion region.
[0146] Please continue to refer to Figure 6 In some embodiments, the method further comprises:
[0147] Step S604, determining iterative expansion parameters for the N+1th iterative expansion according to the first loss result and the second loss result of the Nth iterative expansion.
[0148] In some embodiments, step S604 may be implemented by the following steps:
[0149] Step S6041, when the sum of the first loss result and the second loss result of the Nth iterative expansion is greater than a threshold, the pixel points of each marked point in the iterative expansion area of the Nth iterative expansion are obtained.
[0150] Here, when the sum of the first loss result and the second loss result of the Nth iterative expansion is greater than the threshold, it indicates that the iterative expansion area obtained by the Nth iterative expansion is significantly different from the area where the actual image to be segmented is located, and therefore iterative expansion needs to be continued. Then, the iterative expansion parameters for the next iterative expansion can be determined. In the embodiment of the present application, the iterative expansion parameters can be determined based on the number of pixels in the iterative expansion area.
[0151] Step S6042: Determine the pixel distance between the pixels in the iterative expansion region adjacent to each marked point. The pixel distance refers to the number of pixels.
[0152] Step S6043: Determine the expansion distance for performing the N+1th iterative expansion according to the pixel distance, and obtain an iterative expansion parameter.
[0153] Here, the iterative expansion region closest to the marked point can be determined as the target iterative expansion region, and the pixel distance between the pixel point on the boundary of the target iterative expansion region and the marked point can be determined as the iterative expansion parameter of the N+1th iterative expansion.
[0154] Please continue to refer to Figure 6 Step S404 can be implemented by the following steps:
[0155] Step S605: Obtain a first loss value corresponding to the first loss result and a second loss value corresponding to the second loss result.
[0156] Step S606, determining the sum of the loss values between the first loss value and the second loss value.
[0157] Step S607, determining whether the sum of the loss values is less than a threshold.
[0158] When the judgment result is yes, execute step S608; when the judgment result is no, return to continue executing step S601 or step S603.
[0159] Step S608, stopping the iterative expansion of the marked points.
[0160] In some embodiments, the image to be processed can be processed by an image segmentation model to obtain the area where the object to be segmented in the image to be processed is located. The image segmentation model includes a fully convolutional neural network, which is used to perform image segmentation processing on the sample image. In some embodiments, the image segmentation model also includes an iterative expansion model, which is used to iteratively expand the sample annotation points in the sample image according to the iterative expansion parameters.
[0161] Figure 7 is an optional training flow diagram of the image segmentation model provided in the embodiment of the present application, such as Figure 7 As shown, the training method includes the following steps:
[0162] Step S701, dividing a sample image having at least two sample annotation points to form a background region having at least two sample divided regions. The background region refers to a region formed by the sample divided regions.
[0163] Step S702 , taking each sample annotation point as the center and a preset expansion distance as the radius, expand each sample annotation point in the sample image to form a foreground area having at least two sample expansion areas.
[0164] The foreground area refers to an area formed by the sample expansion area. The foreground area includes an area where the to-be-segmented object of the sample image is located, and does not include an area where the background image of the sample image is located.
[0165] Step S703: The foreground area is taken as a positive sample and input into a fully convolutional neural network for image segmentation processing to obtain a processed image after segmentation.
[0166] Step S704: input the processed image into a preset loss model to obtain a loss result.
[0167] In some embodiments, step S704 may be implemented by the following steps:
[0168] Step S7041, determine the first sample loss value between the sample expansion area and the sample division area through the preset loss model. Step S7042, determine the second sample loss value between the sample expansion area and the sample annotation point through the preset loss model. Step S7043, determine the sum of the first sample loss value and the second sample loss value as the loss result.
[0169] Here, the first sample loss value between the sample expansion area and the sample division area refers to the first distance difference between the boundary of the sample expansion area and the boundary of the sample division area; the second sample loss value between the sample expansion area and the sample annotation point refers to the second distance difference between the boundary of the sample expansion area and the sample annotation point. When both the first distance difference and the second distance difference meet certain conditions, it indicates that the similarity between the formed sample expansion area and the actual area where the object to be segmented is located is high.
[0170] Step S705, determining the iterative expansion parameters of the image segmentation model according to the loss result.
[0171] In some embodiments, step S705 may be implemented by the following steps:
[0172] Step S7051, when the loss result is greater than the threshold, the pixel points in the sample expansion area of each sample annotation point are obtained. Step S7052, the pixel distance between each sample annotation point and the pixel points in the adjacent sample expansion area is determined. Step S7053, according to the pixel distance, the iterative expansion parameter of the image segmentation model is determined.
[0173] Step S706, iteratively dilate the sample annotation points of the sample image using iterative dilation parameters to implement iterative training of the image segmentation model.
[0174] In an embodiment of the present application, during the iterative training process, the weights in the fully convolutional neural network are corrected based on the loss results obtained after each iterative expansion.
[0175] During the implementation process, the similarity between the segmented processed image and the preset processed image can be determined, wherein the preset processed image can be an image obtained after artificial segmentation of the sample image, and the preset processed image includes the area where the object to be segmented is located.
[0176] In an embodiment of the present application, the loss result is determined according to the similarity. If the similarity is greater than the similarity threshold, the correction of the full convolutional neural network is stopped; if the similarity is less than the similarity threshold, the iterative expansion parameter is determined by the above step S705, and the sample annotation points of the sample image are iteratively expanded by the determined iterative expansion parameter, that is, the segmented processed image obtained by the previous expansion of the full convolutional neural network is iteratively expanded again, and the weight parameters of the full convolutional neural network are corrected according to the iterative expansion parameters, and the corrected weight parameters of the full convolutional neural network are output as the weight parameters of the neural network for iteratively expanding the segmented processed image again in the next iterative expansion process.
[0177] In some embodiments, the method further includes: step S71, filtering the processed image according to the iterative expansion parameter to obtain a filtered processed image.
[0178] Here, a distance filter may be used to filter the processed image, so that the boundary of the sample expansion region in the filtered processed image is clearer.
[0179] Correspondingly, step S706 can be implemented by the following steps: Step S7061, performing the iterative expansion on the sample expansion area in the filtered processed image through the iterative expansion parameter to achieve iterative training of the image segmentation model.
[0180] In an embodiment of the present application, in the process of training an image segmentation model, iterative expansion is performed based on pre-labeled sample annotation points, and the loss result is determined according to a first sample loss value between the sample expansion area and the sample division area, and a second sample loss value between the sample expansion area and the sample annotation point, thereby gradually optimizing the image segmentation model. In this way, the optimized image segmentation model can perform accurate image segmentation processing on the image to be processed.
[0181] The following is an explanation of an exemplary application of the embodiments of the present application in a practical application scenario.
[0182] In order to use point annotation to obtain a cell segmentation result equivalent to pixel-level annotation, an embodiment of the present application provides a weakly supervised cell segmentation method based on point annotation, which can effectively reduce the workload of data annotation.
[0183] The method of the embodiment of the present application first generates Voronoi plane partitions using point annotations, and trains the cell segmentation model by simultaneously introducing point annotations and Voronoi partitions as supervisory information, and then uses the prediction results of the cell segmentation model as new point annotations, together with the Voronoi partitions, as a new round of supervisory information to train a new cell segmentation model. The method of the embodiment of the present application, after three rounds of iterations, can enable the segmentation model to accurately segment cells. The main innovative points of the embodiment of the present application are: generating Voronoi partitions through point annotations as additional supervisory information; gradually improving the accuracy of cell segmentation through an iterative method, so that the segmentation model can accurately segment cells.
[0184] In an embodiment of the present application, point annotations and Voronoi boundaries are first used as supervisory information to train the segmentation model, and then the model prediction results are used as new point annotations. The actual cell range is gradually fitted through three rounds of iterations, and a distance filter is introduced in each round of iteration to allow the model to gradually cover the entire cell range, thereby obtaining the final cell segmentation model.
[0185] The embodiment of the present application can provide image processing services in the form of a software interface, wherein the input image to be processed can be a pathological image, and the output processed image is a cell pixel-level segmentation result. Figure 8 As shown, it is a schematic diagram of a product-side application scenario provided by an embodiment of the present application. A pathological image 80 is input, and the pathological image 80 is segmented by a cell segmentation model 81 to obtain a segmentation result 82 and output it.
[0186] The embodiment of the present application provides an image processing method, which is mainly divided into two processes: manual point marking and iterative process. In the manual point marking process, a relatively simple cell position marking is obtained through a manual marking method; in the iterative process, the manual point marking or the model prediction result is passed through a distance filter as a new cell point marking, and the final cell segmentation model is obtained through multiple rounds of iterations.
[0187] Fig. 9 is an optional flow chart of the image processing method provided in the embodiment of the present application, such as Fig. 9 As shown, the method includes two processes: manual point marking and iterative process, wherein the manual point marking process includes the following steps:
[0188] Step S901 , manually marking the pathological image 90 .
[0189] Here, each cell in the pathological image 90 is marked by manual point marking to indicate the location of the cell. Fig.10 As shown, it is an image to be processed after manual point annotation provided in an embodiment of the present application, wherein the image to be processed 1001 after manual point annotation includes at least one annotation point 1002 .
[0190] Please continue to refer to Fig. 9 In the embodiment of the present application, the iteration process includes the following steps:
[0191] Step S902 , filtering the artificial point annotated image through a distance filter to obtain a new cell point annotated image.
[0192] Here, the distance filter obtains a new cell point annotation image by filtering the image, wherein the calculation process of the distance filter is shown in the following formula (1-1):
[0193]
[0194] Among them, d i,j represents the distance of the pixel point (i, j); (k, m) represents the position of the foreground pixel point closest to the pixel point (i, j), wherein the foreground pixel point refers to the pixel point of the foreground image, and the foreground image refers to the image of the cells in the pathological image (i.e., the object to be segmented in the image to be processed); α is a coefficient, which represents the range of the outward expansion of the distance of the pixel point (i, j), for example, it can be set to 0.1, and each time it expands outward by about 10 pixels.
[0195] Step S903, performing cell point annotation processing on the cell point annotation image.
[0196] Here, the result of cell point annotation is initially the result obtained after the manual point annotation is filtered by the distance filter; after participating in the training of the segmentation model, the prediction result of the segmentation model is filtered by the distance filter as a new cell point annotation image, and the new segmentation model is further trained with the new cell point annotation image. In this way, after multiple rounds of iterations, the final cell segmentation model is obtained.
[0197] Step S904, performing Voronoi segmentation on the manually-marked image to obtain a Voronoi segmentation image.
[0198] Since the plane can be divided by Voronoi through manual point marking, the Voronoi division technique can be used to divide the plane to obtain the Voronoi boundary, and then obtain the Voronoi division image. It should be noted that the Voronoi boundary remains unchanged during the iteration process. Fig.11 is a schematic diagram of the voro noi division image provided by the embodiment of the present application, such as Fig.11 As shown, the Voronoi division is shown by white lines. The Voronoi division image 110 obtained by the Voronoi division includes at least one closed division area 111, and each division area includes an artificially marked point 112.
[0199] Fig.12 is a schematic diagram of the iterative process of cell point labeling provided in the embodiment of the present application, such as Fig.12 As shown, the first column 121 is the original pathological image (i.e., the image to be processed), the second column 122 is the Voronoi partitioned image, and the third column 123 is the iterative process of cell point labeling. In each iterative process, the cell point labeled image is input into a fully convolutional neural network 124 (FCN, Fully Convolutional Network) for convolution processing to obtain a processed image 125.
[0200] In the next iteration, the processed image 125 obtained last time will be filtered through the distance filter, and the filtered processed image will be used as the input image in the next iteration, and then input into the full convolutional neural network 124, and the cycle will be repeated to complete the cell segmentation of the pathological image and train the cell segmentation model.
[0201] It should be noted that Fig.12 The single dashed arrow 126 in the figure represents replication, that is, the pathological image in the first column 121 and the Voronoi divided image in the second column 122 are the same in each iteration process; the double dashed arrow 127 represents distance filter filtering, that is, after each iteration process is completed, the processed image 125 will be filtered by distance filter once; the single solid arrow 128 represents weight transfer, that is, in each iteration process, the weight of the full convolutional neural network 124 will be iteratively updated according to the loss result, and the updated weight will be transferred to the full convolutional neural network 124 in the next iteration process.
[0202] Step S905: training a segmentation model based on the cell point annotation image and the Voronoi segmentation image.
[0203] For cell point annotation images and Voronoi partitioned images, training can be performed by introducing a cell point annotation loss model (point loss) and a Voronoi loss model (voronoi loss), wherein the cell point annotation loss model and the Voronoi loss model are used to calculate the loss using the following loss functions (1-2) and (1-3):
[0204]
[0205]
[0206] Among them, Loss point Represents the loss result of the cell point annotation loss model; Loss voronoi represents the loss result of the voronoi loss model; D represents the cell point annotation, V represents the boundary of the divided area in the voronoi divided image; I represents the input pathological image; f represents the segmentation model; ReLU represents the linear rectification function; || || F represents the F norm (Frobenius norm); Represents the square of the F norm. It should be noted that the overall loss result of the training model is Loss point and Loss voronoi The sum.
[0207] In the embodiment of the present application, the training process can use any data set for training. For example, the public data set Monuseg can be used. After data enhancement of the sample images in the data set, the data enhancement images are input as training data into the FCN model for training. In some embodiments, the FCN model includes but is not limited to LinkNet model and Densenet model and other fully convolutional neural network models. The weight initialization of the model can use the image net data set (wherein the size of the input image is 512*512 pixels, the batch size is 8, the learning rate is 0.0001, and the maximum number of iterations is 200 epochs), and finally a cell segmentation model 91 is obtained.
[0208] In the embodiment of the present application, the cell segmentation result 92 represents the prediction result of the cell segmentation model 91 for the training data obtained in each round of iteration, such as Fig.12 The processed image 125 is shown in the last column.
[0209] The image processing method provided in the embodiment of the present application has strong applicability, is independent of the hardware environment, and can process various types of pathological images. Figures 13A to 13C is a schematic diagram of the results of processing various types of pathological images using the cell segmentation model 13 of the embodiment of the present application, such as Figures 13A to 13CAs shown, the input is pathological image 131, pathological image 133 and pathological image 135. After the pathological image 131, pathological image 133 and pathological image 135 are processed respectively by the cell segmentation model 13, the corresponding processed image 132, processed image 134 and processed image 136 are obtained respectively.
[0210] It should be noted that in the embodiment of the present application, a preset number of iterations can be used, for example, three rounds of iterations can be used to train the manual point annotation, and the number of iterations can be adjusted according to the difference in cell size. The FCN model in the segmentation model can also use other segmentation models to replace the LinkNet model, for example, using a densenet model to replace the LinkNet model. The distance filter can also be replaced by a Gaussian filter or the like.
[0211] The following is a description of an exemplary structure of the image processing device 354 provided in the embodiment of the present application implemented as a software module. In some embodiments, Figure 3 As shown, the software module stored in the image processing device 354 of the memory 350 may be the image processing device in the server 300, including:
[0212] An acquisition module 3541 is used to acquire an image to be processed having at least two divided regions, each of which includes a marked point, and each of which corresponds to an object to be segmented;
[0213] An iterative expansion module 3542 is used to iteratively expand each of the annotation points in the image to be processed to obtain an iterative expansion region corresponding to the annotation point;
[0214] A first determination module 3543, used to respectively determine a first loss result between the iteratively expanded region and the divided region, and a second loss result between the iteratively expanded region and the marked point;
[0215] A control module 3544 is configured to stop iterative expansion of the corresponding annotation point when the first loss result and the second loss result meet an iteration termination condition;
[0216] The second determination module 3545 is used to determine the iterative expansion area obtained when the iterative expansion is stopped as the area where the object to be segmented in the image to be processed is located.
[0217] In some embodiments, the apparatus further comprises:
[0218] A third determination module, configured to determine an iterative expansion parameter for an N+1th iterative expansion according to the first loss result and the second loss result of the Nth iterative expansion;
[0219] The iterative expansion module is further used to: adopt the iterative expansion parameters to iteratively expand each of the annotation points in the image to be processed to obtain an iterative expansion region corresponding to the annotation point.
[0220] In some embodiments, the iterative expansion parameters include an expansion distance; the iterative expansion module is also used to: iteratively expand each of the annotation points in the image to be processed with each of the annotation points as the center and the expansion distance as the radius to form an iterative expansion area corresponding to the annotation point.
[0221] In some embodiments, the third determination module is also used for: when the sum of the first loss result and the second loss result of the Nth iterative expansion is greater than a threshold, obtaining the pixel points of each of the annotation points within the iterative expansion area of the Nth iterative expansion; determining the pixel distance between the pixel points within the iterative expansion area adjacent to each of the annotation points; and determining the expansion distance for the N+1th iterative expansion based on the pixel distance to obtain the iterative expansion parameters.
[0222] In some embodiments, the control module is also used to: obtain a first loss value corresponding to the first loss result and a second loss value corresponding to the second loss result; determine the sum of the loss values between the first loss value and the second loss value; when the sum of the loss values is less than a threshold, stop the iterative expansion of the annotation point.
[0223] In some embodiments, the iterative expansion module is also used to: perform initial expansion on each of the annotation points in the image to be processed with each of the annotation points as the center and a preset expansion distance as the radius to form a foreground area with at least two expansion areas; perform at least one iterative expansion on each of the expansion areas in the foreground area with each of the annotation points as the center and the preset expansion distance as the radius to obtain the iterative expansion area of the corresponding annotation point.
[0224] In some embodiments, the image to be processed is a pathological image, and the object to be segmented is a cell; the second determination module is further used to: determine the iterative expansion area obtained when the iterative expansion is stopped as the area where the cells in the pathological image are located.
[0225] In some embodiments, in some embodiments, the device also includes: a processing module, used to process the image to be processed through an image segmentation model to obtain the area where the object to be segmented in the image to be processed is located; the image segmentation model includes a fully convolutional neural network and an iterative expansion model, the fully convolutional neural network is used to perform image segmentation processing on the sample image, and the iterative expansion model is used to iteratively expand the sample annotation points in the sample image according to the iterative expansion parameters.
[0226] In some embodiments, the image segmentation model is trained by the following steps: dividing a sample image having at least two sample annotation points to form a background area having at least two sample divided areas; expanding each of the sample annotation points in the sample image with each of the sample annotation points as the center and a preset expansion distance as the radius to form a foreground area having at least two sample expansion areas; taking the foreground area as a positive sample and inputting it into a fully convolutional neural network for image segmentation processing to obtain a segmented processed image; inputting the processed image into a preset loss model to obtain a loss result; determining the iterative expansion parameters of the image segmentation model based on the loss result; and iteratively expanding the sample annotation points of the sample image using the iterative expansion parameters to achieve iterative training of the image segmentation model.
[0227] In some embodiments, the image segmentation model is trained through the following steps: determining a first sample loss value between the sample expansion area and the sample division area through the preset loss model; determining a second sample loss value between the sample expansion area and the sample annotation point through the preset loss model; and determining the sum of the first sample loss value and the second sample loss value as the loss result.
[0228] In some embodiments, the image segmentation model is trained by the following steps: when the loss result is greater than a threshold, obtaining pixel points within the sample expansion area of each sample annotation point; determining the pixel distance between each sample annotation point and the pixel points within the adjacent sample expansion area; and determining the iterative expansion parameters of the image segmentation model based on the pixel distance.
[0229] In some embodiments, the processing module is also used to: filter the processed image according to the iterative expansion parameters to obtain a filtered processed image; correspondingly, the image segmentation model is trained through the following steps: perform the iterative expansion of the sample expansion area in the filtered processed image through the iterative expansion parameters to achieve iterative training of the image segmentation model.
[0230] It should be noted that the description of the device of the embodiment of the present application is similar to the description of the above method embodiment, and has similar beneficial effects as the method embodiment, so it is not repeated. For technical details not disclosed in the embodiment of the device, please refer to the description of the method embodiment of the present application for understanding.
[0231] The present application embodiment provides a storage medium storing executable instructions, wherein the executable instructions are stored. When the executable instructions are executed by a processor, the processor will execute the method provided by the present application embodiment, for example, Figure 4The method shown.
[0232] In some embodiments, the storage medium can be a computer-readable storage medium, for example, a ferroelectric random access memory (FRAM), a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), a flash memory, a magnetic surface memory, an optical disk, or a compact disk read-only memory (CD-ROM), etc.; it can also be various devices including one or any combination of the above memories.
[0233] In some embodiments, executable instructions may be in the form of a program, software, software module, script or code, written in any form of programming language (including compiled or interpreted languages, or declarative or procedural languages), and may be deployed in any form, including as a stand-alone program or as a module, component, subroutine or other unit suitable for use in a computing environment.
[0234] As examples, executable instructions may, but need not, correspond to a file in a file system, may be stored as part of a file storing other programs or data, such as one or more scripts in a HyperText Markup Language (HTML) document, in a single file dedicated to the program in question, or in multiple coordinated files (e.g., files storing one or more modules, subroutines, or code portions). As examples, executable instructions may be deployed to be executed on one computing device, or on multiple computing devices located at one location, or on multiple computing devices distributed at multiple locations and interconnected by a communication network.
[0235] The above is only an embodiment of the present application and is not intended to limit the protection scope of the present application. Any modifications, equivalent substitutions and improvements made within the spirit and scope of the present application are included in the protection scope of the present application.
Claims
1. An image processing method, characterized in that: include: Acquire an image to be processed having at least two divided regions, each of the divided regions including a marked point, and each of the marked points corresponds to an object to be segmented; Iteratively dilate each of the annotation points in the image to be processed by using an iterative dilation parameter to obtain an iterative dilation region corresponding to the annotation point, wherein the iterative dilation parameter includes a dilation distance, and the dilation distance of each dilation is a random value determined according to the current iterative dilation region; Determine respectively a first loss result between the iterative expansion area and the divided area, and a second loss result between the iterative expansion area and the marked point by a preset loss model; Obtaining a first loss value corresponding to the first loss result and a second loss value corresponding to the second loss result; determining a sum of the loss values between the first loss value and the second loss value; and stopping iterative expansion of the annotation point when the sum of the loss values is less than a threshold; The iterative expansion region obtained when the iterative expansion is stopped is determined as the region where the object to be segmented in the image to be processed is located.
2. The method according to claim 1, characterized in that The method further comprises: An iterative expansion parameter for the N+1th iterative expansion is determined according to the first loss result and the second loss result of the Nth iterative expansion, where N is greater than or equal to 1.
3. The method according to claim 1, characterized in that: The iterative expansion parameters are used to iteratively expand each of the annotation points in the image to be processed to obtain an iterative expansion region corresponding to the annotation point, including: Taking each of the marked points as a center and the expansion distance as a radius, each of the marked points in the image to be processed is iteratively expanded to form an iterative expansion area corresponding to the marked point.
4. The method according to claim 2, characterized in that: The determining, according to the first loss result and the second loss result of the Nth iterative expansion, an iterative expansion parameter for the N+1th iterative expansion comprises: When the sum of the first loss result and the second loss result of the N-th iterative expansion is greater than a threshold, obtaining a pixel point of each of the annotation points within the iterative expansion area of the N-th iterative expansion; Determining the pixel distance between the pixel points in the iterative expansion area adjacent to each of the marked points; According to the pixel distance, the expansion distance used for performing the N+1th iterative expansion is determined to obtain the iterative expansion parameter.
5. The method according to claim 1, characterized in that The iterative expansion of each of the annotation points in the image to be processed to obtain an iterative expansion region corresponding to the annotation point includes: Taking each of the marked points as a center and a preset expansion distance as a radius, initially expanding each of the marked points in the image to be processed to form a foreground area having at least two expansion areas; Taking each of the marked points as the center and the preset expansion distance as the radius, each of the expansion areas in the foreground area is iteratively expanded at least once to obtain an iterative expansion area corresponding to the marked point.
6. The method according to claim 1, characterized in that The method further comprises: Processing the image to be processed by using an image segmentation model to obtain a region where the object to be segmented in the image to be processed is located; The image segmentation model includes a fully convolutional neural network, and the fully convolutional neural network is used to perform image segmentation processing on the sample image.
7. The method according to claim 6, characterized in that The image segmentation model is trained by the following steps: Dividing a sample image having at least two sample annotation points to form a background area having at least two sample divided areas; Taking each of the sample annotation points as a center and a preset expansion distance as a radius, each of the sample annotation points in the sample image is expanded to form a foreground area having at least two sample expansion areas; The foreground area is used as a positive sample and input into a fully convolutional neural network for image segmentation processing to obtain a processed image after segmentation; Inputting the processed image into a preset loss model to obtain a loss result; Determining an iterative expansion parameter of the image segmentation model according to the loss result; The sample annotation points of the sample image are iteratively expanded using the iterative expansion parameters to achieve iterative training of the image segmentation model.
8. The method according to claim 7, characterized in that The step of inputting the processed image into a preset loss model to obtain a loss result includes: Determining a first sample loss value between the sample expansion area and the sample division area by using the preset loss model; Determining a second sample loss value between the sample expansion area and the sample annotation point by using the preset loss model; The sum of the first sample loss value and the second sample loss value is determined as the loss result.
9. The method according to claim 7, characterized in that: Determining the iterative expansion parameters of the image segmentation model according to the loss result includes: When the loss result is greater than a threshold, obtaining pixel points within the sample expansion area of each sample annotation point; Determine the pixel distance between each sample annotation point and a pixel point in an adjacent sample expansion area; An iterative dilation parameter of the image segmentation model is determined according to the pixel distance.
10. The method according to claim 7, characterized in that The method further comprises: filtering the processed image according to the iterative expansion parameter to obtain a filtered processed image; Correspondingly, the sample annotation points of the sample image are iteratively expanded by the iterative expansion parameters to implement iterative training of the image segmentation model, including: The iterative expansion is performed on the sample expansion area in the filtered processed image through the iterative expansion parameter to achieve iterative training of the image segmentation model.
11. An image processing method, characterized in that: include: Acquire a pathological image having at least two divided regions, each of the divided regions includes a marked point, and each of the marked points corresponds to a cell; Iteratively dilate each of the annotated points in the pathological image using an iterative dilation parameter to obtain an iterative dilation region corresponding to the annotated point, wherein the iterative dilation parameter includes a dilation distance, and the dilation distance of each dilation is a random value determined according to the current iterative dilation region; Determine respectively a first loss result between the iterative expansion area and the divided area, and a second loss result between the iterative expansion area and the marked point by a preset loss model; Obtaining a first loss value corresponding to the first loss result and a second loss value corresponding to the second loss result; determining a sum of the loss values between the first loss value and the second loss value; and stopping iterative expansion of the annotation point when the sum of the loss values is less than a threshold; The iterative expansion region obtained when the iterative expansion is stopped is determined as the region where the cells in the pathological image are located.
12. An image processing device, characterized in that: include: An acquisition module, used for acquiring an image to be processed having at least two divided areas, each of the divided areas including a marked point; An iterative expansion module, configured to iteratively expand each of the annotation points in the image to be processed using an iterative expansion parameter to obtain an iterative expansion region corresponding to the annotation point, wherein the iterative expansion parameter includes an expansion distance, and the expansion distance of each expansion is a random value determined according to the current iterative expansion region; A first determination module, used to determine a first loss result between the iterative expansion area and the divided area, and a second loss result between the iterative expansion area and the marked point respectively through a preset loss model; A control module, configured to obtain a first loss value corresponding to the first loss result and a second loss value corresponding to the second loss result; determine a sum of the loss values between the first loss value and the second loss value; and stop iterative expansion of the annotation point when the sum of the loss values is less than a threshold; The second determination module is used to determine the iterative expansion area obtained when the iterative expansion is stopped as the area where the object to be segmented in the image to be processed is located.
13. A computer-readable storage medium, characterized in that: Executable instructions are stored, which are used to cause a processor to execute and implement any one of claims 1 to 10, or the method of claim 11.
