Cascade segmentation network-based bacterial colony area image segmentation method, apparatus and device
Automatically segmenting the colony area image by a method based on a cascade segmentation network, the problem of cumbersome segmentation process and susceptibility to manual intervention in the prior art is solved, and efficient and reliable segmentation effect is achieved.
Patent Information
- Application Number
- CN202411842770.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-13
- Publication Date
- 2025-04-11
- Estimated Expiration
- 2044-12-13
AI Technical Summary
The current segmentation process of colony area images is cumbersome, which is not conducive to improving segmentation efficiency and is easily affected by artificial intervention.
Using a method based on a cascade segmentation network, the original image is acquired and pre-processed, combined with the preset rough semantic segmentation diagram and background diagram, input the cascade segmentation network for processing, and generate the initial and target segmentation result diagrams, thereby automatically segmenting the colony area image.
The segmentation time of colony area images is reduced, segmentation efficiency is improved, and the reliability of segmentation results is improved, avoiding the influence of manual intervention.
Smart Images

Figure CN119810436A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the fields of artificial intelligence and microorganisms, and in particular to a method, device and equipment for segmenting colony region images based on a cascade segmentation network. Background Art
[0002] Colony area images provide intuitive visual information, allowing users to clearly observe key indicators such as colony morphology, size, color, and edge characteristics, which is essential for rapid identification and classification of microorganisms. In addition, colony area images can also be used for subsequent digital processing and data analysis, such as automatic counting of colonies, to improve the accuracy and efficiency of research.
[0003] However, the current segmentation process of colony region images is cumbersome and not conducive to improving the segmentation efficiency of colony region images. The reason is that the original image incorporates a complex background, which increases the difficulty of segmenting the colony region image from the original image, making it difficult for traditional image segmentation algorithms to segment the colony region image from the original image. In order to obtain accurate segmentation results, users can only adopt manual segmentation methods, which are not only time-consuming and labor-intensive, but also easily affected by human intervention. Therefore, it is not conducive to improving the segmentation efficiency of colony region images. Summary of the invention
[0004] The present invention provides a colony region image segmentation method, device, computer equipment and storage medium based on a cascade segmentation network to solve the technical problem that the current colony region image segmentation process is cumbersome and is not conducive to improving the colony region image segmentation efficiency.
[0005] In a first aspect, a colony region image segmentation method based on a cascade segmentation network is provided, comprising:
[0006] Get the original image of the bacterial colonies in the current culture dish taken by the camera;
[0007] Preprocessing the original image to obtain the processed original image;
[0008] Obtaining a preset rough semantic segmentation map and a preset background map, and inputting the processed original image, the background map and the rough semantic segmentation map into a cascade segmentation network;
[0009] The original image, the background image and the rough semantic segmentation image are processed by the initial segmentation network in the cascade segmentation network to generate an initial segmentation result image;
[0010] Inputting the processed original image, the background image and the initial segmentation result image into the target segmentation network, wherein the target segmentation network is the next segmentation network of the initial segmentation network;
[0011] The processed original image, the background image and the initial segmentation result image are processed through the target segmentation network to generate a target segmentation result image. According to the target segmentation result image, the image area where the colony is located is segmented from the processed original image, and the image area where the colony is located is selected as the colony area image.
[0012] Furthermore, the preprocessing of the original image to obtain the processed original image includes:
[0013] The original image is subjected to channel separation to obtain a single-channel image, a preset square structure element 1 is used to perform a bottom-hat transformation process on the single-channel image to obtain a first result image, and a preset square structure element 2 is used to perform a bottom-hat transformation process on the single-channel image to obtain a second result image;
[0014] Performing morphological processing on the first result image and the second result image respectively to select a plurality of initial colony regions;
[0015] The initial colony regions are combined to form a combined region, and the combined region is subjected to boundary operation to obtain a final target colony region, which is then marked on the original image.
[0016] Furthermore, the obtaining of a preset rough semantic segmentation map and a preset background map, and inputting the processed original image, the background map and the rough semantic segmentation map into a cascade segmentation network, comprises:
[0017] Obtaining a model file, and loading the cascade segmentation network in the model file to obtain a loading result;
[0018] When the loading result is successful, a preset coarse semantic segmentation map and a preset background map are obtained, and the processed original image, the background map and the coarse semantic segmentation map are input into a cascade segmentation network.
[0019] Furthermore, the initial segmentation network in the cascade segmentation network is used to process the original image, the background image and the rough semantic segmentation image to generate an initial segmentation result image, including:
[0020] The feature vector of the original image, the feature vector of the background image and the feature vector of the rough semantic segmentation image are concatenated to obtain an initial feature vector;
[0021] The initial feature vector is processed through the initial segmentation network to generate an initial segmentation result map.
[0022] Furthermore, the step of inputting the processed original image, the background image and the initial segmentation result image into the target segmentation network comprises:
[0023] In the cascade segmentation network, selecting a next segmentation network of the initial segmentation network as a target segmentation network;
[0024] An input instruction is obtained, the input instruction is executed, and the processed original image, the background image and the initial segmentation result image are input into the target segmentation network.
[0025] Furthermore, the target segmentation network is used to process the processed original image, the background image and the initial segmentation result image to generate a target segmentation result image, and according to the target segmentation result image, the image region where the colony is located is segmented from the processed original image, and the image region where the colony is located is selected as the colony region image, including:
[0026] The feature vector of the original image, the feature vector of the background image and the feature vector of the initial segmentation result image are concatenated to obtain a target feature vector, and the target feature vector is processed by the target segmentation network to generate a target segmentation result image;
[0027] When the target segmentation network is the last segmentation network, the image region where the colony is located is segmented from the processed original image according to the target segmentation result image, and the image region where the colony is located is selected as the colony region image.
[0028] Furthermore, after the processed original image, the background image and the initial segmentation result image are processed by the target segmentation network to generate a target segmentation result image, the image region where the colony is located is segmented from the processed original image according to the target segmentation result image, and the image region where the colony is located is selected as the colony region image, the colony region image segmentation method includes:
[0029] A push instruction is obtained, the push instruction is executed, and the colony area image is pushed to a target system.
[0030] Furthermore, before the acquisition camera captures the original image of the colonies in the current culture dish, the colony region image segmentation method includes:
[0031] A sample image is obtained by taking a camera to capture a colony in a preset culture dish;
[0032] Obtain the predicted segmentation result map generated by the cascade segmentation network based on the sample image, and calculate the loss value between the predicted segmentation result map and the true segmentation result map through the loss function;
[0033] Adjusting the loss value by using the first weight value and the second weight value to obtain the adjusted loss value;
[0034] When the adjusted loss value converges, the cascade segmentation network is saved.
[0035] In a second aspect, a colony region image segmentation device based on a cascade segmentation network is provided, comprising:
[0036] The first acquisition module is used to acquire the original image of the bacterial colonies in the current culture dish taken by the camera;
[0037] A processing module, used for preprocessing the original image to obtain the processed original image;
[0038] A second acquisition module is used to acquire a preset rough semantic segmentation map and a preset background map, and input the processed original image, the background map and the rough semantic segmentation map into a cascade segmentation network;
[0039] A generation module, used to process the original image, the background image and the rough semantic segmentation image through the initial segmentation network in the cascade segmentation network to generate an initial segmentation result image;
[0040] An input module, used for inputting the processed original image, the background image and the initial segmentation result image into the target segmentation network, wherein the target segmentation network is the next segmentation network of the initial segmentation network;
[0041] The segmentation module is used to process the processed original image, the background image and the initial segmentation result image through the target segmentation network to generate a target segmentation result image, and according to the target segmentation result image, segment the image area where the colony is located from the processed original image, and select the image area where the colony is located as the colony area image.
[0042] In a third aspect, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the above-mentioned colony area image segmentation method when executing the computer program.
[0043] In a fourth aspect, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the above-mentioned colony area image segmentation method are implemented.
[0044] The present application provides a colony area image segmentation method, device, computer equipment and storage medium based on a cascade segmentation network, which obtains an original image obtained by taking a camera to capture the colonies in the current culture dish; preprocesses the original image to obtain the processed original image; obtains a preset rough semantic segmentation map and a preset background map, and inputs the processed original image, the background map and the rough semantic segmentation map into a cascade segmentation network; processes the original image, the background map and the rough semantic segmentation map through an initial segmentation network in the cascade segmentation network to generate an initial segmentation result map; inputs the processed original image, the background map and the initial segmentation result map into the target segmentation network, and the target segmentation network is the next segmentation network of the initial segmentation network; and processes the processed original image, the background map and the rough semantic segmentation map through the target segmentation network. The initial segmentation result map is processed to generate a target segmentation result map, and the image area where the colony is located is segmented from the processed original image according to the target segmentation result map, and the image area where the colony is located is selected as the colony area image. The beneficial effects are in two aspects. On the one hand, the processed original image, the background image and the initial segmentation result map are processed by the target segmentation network to generate a target segmentation result map, and the image area where the colony is located is segmented from the processed original image according to the target segmentation result map, and the image area where the colony is located is selected as the colony area image. Since no manual segmentation is required, the segmentation time of the colony area image is reduced, which is beneficial to improving the segmentation efficiency of the colony area image. On the other hand, due to the cascade segmentation network, it will not be affected by manual intervention, which is beneficial to improving the reliability of the colony area image. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments of the present invention will be briefly introduced below. Obviously, the accompanying drawings in the following description are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative labor.
[0046] Figure 1 Schematic diagram of an application environment of a method for segmenting a colony region image in one embodiment of the present invention;
[0047] Figure 2 A schematic flow chart of a method for segmenting a colony region image provided by an embodiment of the present invention;
[0048] Figure 3 yes Figure 2 A schematic flow chart of a specific implementation of step S23;
[0049] Figure 4 yes Figure 2 A schematic flow chart of a specific implementation of step S25;
[0050] Figure 5 yes Figure 2 A schematic flow chart of a specific implementation of step S26;
[0051] Figure 6 is a structural schematic diagram of a bacterial colony region image segmentation device in one embodiment of the present invention;
[0052] Figure 7 is a schematic diagram of a structure of a computer device in one embodiment of the present invention;
[0053] Figure 8 This is a sample diagram provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0054] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0055] See also Figure 1 , Figure 1 FIG. 1 is a schematic diagram of an application environment of a method for segmenting a colony region image according to an embodiment of the present invention. The method for segmenting a colony region image according to an embodiment of the present invention can be applied in the following embodiments: Figure 1 In an application environment, a client communicates with a server through a network.
[0056] The server obtains the original image of the bacterial colony in the current culture dish taken by the camera through the client;
[0057] Preprocessing the original image to obtain the processed original image;
[0058] Obtaining a preset rough semantic segmentation map and a preset background map, and inputting the processed original image, the background map and the rough semantic segmentation map into a cascade segmentation network;
[0059] The original image, the background image and the rough semantic segmentation image are processed by the initial segmentation network in the cascade segmentation network to generate an initial segmentation result image;
[0060] Inputting the processed original image, the background image and the initial segmentation result image into the target segmentation network, wherein the target segmentation network is the next segmentation network of the initial segmentation network;
[0061] The processed original image, the background image and the initial segmentation result image are processed through the target segmentation network to generate a target segmentation result image. According to the target segmentation result image, the image area where the colony is located is segmented from the processed original image, and the image area where the colony is located is selected as the colony area image.
[0062] In the scheme implemented by the above-mentioned colony area image segmentation method, device, equipment and medium, the beneficial effects lie in two aspects. On the one hand, the processed original image, the background image and the initial segmentation result image are processed through the target segmentation network to generate a target segmentation result image. According to the target segmentation result image, the image area where the colony is located is segmented from the processed original image, and the image area where the colony is located is selected as the colony area image. Since no manual segmentation is required, the segmentation time of the colony area image is reduced, which is beneficial to improving the segmentation efficiency of the colony area image. On the other hand, due to the cascade segmentation network, it will not be affected by manual intervention, so it is beneficial to improve the reliability of the colony area image.
[0063] The device running the client is referred to as a client device.
[0064] The device running the server is referred to as the server device.
[0065] Among them, client devices include but are not limited to smartphones, personal computers, Internet of Vehicles terminals, tablets and portable wearable devices.
[0066] The server device can be implemented by an independent server or a server cluster composed of multiple servers. The present invention is described in detail below through specific embodiments.
[0067] See also Figure 2 , Figure 2 A schematic flow chart of a method for segmenting a colony region image provided by an embodiment of the present invention includes the following steps:
[0068] S21, obtaining an original image of the bacterial colonies in the current culture dish captured by the camera;
[0069] The original image of the bacterial colony in the current culture dish captured by the camera is obtained, including:
[0070] Connecting to a camera and accessing storage files of the camera;
[0071] In the storage file of the camera, the original image obtained by photographing the bacterial colonies in the current culture dish by the camera is read.
[0072] Among them, by shooting with a camera, the growth morphology, color changes and distribution characteristics of the colonies can be intuitively recorded and observed, which is crucial for microbiological research and quality control.
[0073] Before the camera is used to capture the original image of the colonies in the current culture dish, the colony region image segmentation method includes:
[0074] A sample image is obtained by taking a camera to capture a colony in a preset culture dish;
[0075] Obtain the predicted segmentation result map generated by the cascade segmentation network based on the sample image, and calculate the loss value between the predicted segmentation result map and the true segmentation result map through the loss function;
[0076] Adjusting the loss value by using the first weight value and the second weight value to obtain the adjusted loss value;
[0077] When the adjusted loss value converges, the cascade segmentation network is saved.
[0078] The loss value is adjusted by using the first weight value and the second weight value to obtain the adjusted loss value, including:
[0079] Obtaining a foreground point and a background point in the predicted image, selecting a weight value corresponding to the Euclidean distance from the foreground point to the segmentation edge as a first weight value, and selecting a weight value corresponding to the Euclidean distance from the background point to the segmentation edge as a second weight value;
[0080] The loss value is multiplied by a first weight value to obtain a first target value, the loss value is multiplied by a second weight value to obtain a second target value, and the first target value and the second target value are added to obtain the adjusted loss value.
[0081] Among them, background points refer to the pixels in the predicted image that are considered not to belong to the colony.
[0082] The segmentation edge refers to the boundary between the colony and the background in the predicted image.
[0083] Among them, Euclidean distance, also known as Euclidean distance, reflects the actual distance between two points in space, which is easy to understand and apply.
[0084] S22, preprocessing the original image to obtain the processed original image;
[0085] The preprocessing of the original image to obtain the processed original image includes:
[0086] The original image is subjected to channel separation to obtain a single-channel image, a preset square structure element 1 is used to perform a bottom-hat transformation process on the single-channel image to obtain a first result image, and a preset square structure element 2 is used to perform a bottom-hat transformation process on the single-channel image to obtain a second result image;
[0087] Performing morphological processing on the first result image and the second result image respectively to select a plurality of initial colony regions;
[0088] The initial colony regions are combined to form a combined region, and the combined region is subjected to boundary operation to obtain a final target colony region, which is then marked on the original image.
[0089] Among them, the original image with the target colony area marked is selected as the processed original image.
[0090] The preset square structure element 1 includes one of a 55×55 square structure element and a 155×155 square structure element.
[0091] The preset square structure element 2 includes one of a 55×55 square structure element and a 155×155 square structure element.
[0092] Among them, the size of the square structure element will affect the processing effect.
[0093] During the first top-hat transformation or bottom-hat transformation, a 55×55 square structure element is used to perform a top-hat transformation on the original image. After the first top-hat transformation or bottom-hat transformation, if there are large colonies that have not been processed, a 155×155 square structure element is used to perform a top-hat transformation or bottom-hat transformation on the original image.
[0094] Under the action of top hat transformation or bottom hat transformation, the contrast between the background and the colonies in the processed original image is significantly improved, the morphology and boundaries of the colonies are clearer, and the problem of uneven lighting is also effectively improved, thereby reducing background interference. Therefore, the processed original image is conducive to identifying and segmenting different colony area images.
[0095] S23, obtaining a preset rough semantic segmentation map and a preset background map, and inputting the processed original image, the background map and the rough semantic segmentation map into a cascade segmentation network;
[0096] Among them, the cascade segmentation network can gradually refine the segmentation results. Each cascade segmentation network further extracts features based on the previous network, thereby gradually optimizing the segmentation results. This gradual refinement process helps capture tiny structures and details in the image and improves the accuracy of segmentation.
[0097] Optionally, the network model of the cascade segmentation network adopts mobilenetv2, the Chinese expression of MobileNetV2 is: mobile network V2, and its full English name is: MobileNetV2. MobileNetV2 is a lightweight convolutional neural network model.
[0098] S24, processing the original image, the background image and the rough semantic segmentation image through the initial segmentation network in the cascade segmentation network to generate an initial segmentation result image;
[0099] Among them, the rough semantic segmentation map refers to a segmentation image in which the segmentation results obtained in the image semantic segmentation task show discontinuous edges, inaccurate category division, or a large number of misclassified pixels due to limitations of factors such as algorithm performance, training data quality, or model complexity. The rough semantic segmentation map can provide approximate distribution information about the main objects or regions in the image. Using the rough semantic segmentation map is conducive to reducing the amount of calculation and improving the processing speed.
[0100] Among them, the cascade segmentation network includes an initial segmentation network and a target segmentation network.
[0101] The process of processing the original image, the background image and the rough semantic segmentation image through the initial segmentation network in the cascade segmentation network to generate an initial segmentation result image includes:
[0102] The feature vector of the original image, the feature vector of the background image and the feature vector of the rough semantic segmentation image are concatenated to obtain an initial feature vector;
[0103] The initial feature vector is processed through the initial segmentation network to generate an initial segmentation result map.
[0104] Among them, the initial segmentation result diagram shows the preliminary division of different areas in the original image.
[0105] S25, inputting the processed original image, the background image and the initial segmentation result image into the target segmentation network, the target segmentation network being the next segmentation network of the initial segmentation network;
[0106] The next segmentation network can further extract features from the processed original image based on the initial segmentation network. By gradually refining these features, the next segmentation network can generate more accurate and detailed segmentation results, thereby improving the accuracy of the overall segmentation.
[0107] S26, through the target segmentation network, the processed original image, the background image and the initial segmentation result image are processed to generate a target segmentation result image, and according to the target segmentation result image, the image area where the colony is located is segmented from the processed original image, and the image area where the colony is located is selected as the colony area image.
[0108] Among them, since the target segmentation result map provides the boundary and shape information of each colony, the image area where the colony is located can be segmented from the processed original image according to the target segmentation result map, and the image area where the colony is located can be selected as the colony area image.
[0109] Different bacterial colonies have different shapes, colors and growth characteristics. By determining different bacterial colony region images in the processed original image, these characteristics can be observed and analyzed more carefully, which is conducive to classifying and identifying bacterial colonies.
[0110] For the sake of illustration, an example is given below:
[0111] For example: the original image has colony 1, colony 2, and colony 3;
[0112] The target segmentation result map provides the boundaries of colony 1, colony 2, and colony 3;
[0113] Segment the image region where the colony 1 is located from the processed original image, and select the image region where the colony 1 is located as the colony region image 1;
[0114] Segment the image region where the colony 2 is located from the processed original image, and select the image region where the colony 2 is located as the colony region image 2;
[0115] The image region where the colony 3 is located is segmented from the processed original image, and the image region where the colony 3 is located is selected as the colony region image 3.
[0116] Among them, colony 1, colony 2, and colony 3 have different shapes, colors, and growth characteristics. By determining the colony region image 1, colony region image 2, and colony region image 3 in the processed original image, the characteristics of colony 1, colony 2, and colony 3 can be observed and analyzed more carefully, which is conducive to the classification and identification of colony 1, colony 2, and colony 3.
[0117] For ease of explanation, refer to Figure 8 , Figure 8 This is a sample diagram provided by an embodiment of the present invention.
[0118] from Figure 8As you can see, the sample image shows the image effect of the target segmentation result map. The target segmentation result map provides the boundary and shape information of each colony.
[0119] Wherein, after the processed original image, the background image and the initial segmentation result image are processed by the target segmentation network to generate a target segmentation result image, the image region where the colony is located is segmented from the processed original image according to the target segmentation result image, and the image region where the colony is located is selected as the colony region image, the colony region image segmentation method includes:
[0120] A push instruction is obtained, the push instruction is executed, and the colony area image is pushed to a target system.
[0121] In the embodiment of the present invention, the beneficial effects lie in two aspects. On the one hand, the processed original image, the background image and the initial segmentation result image are processed through the target segmentation network to generate a target segmentation result image. According to the target segmentation result image, the image area where the colony is located is segmented from the processed original image, and the image area where the colony is located is selected as the colony area image. Since no manual segmentation is required, the segmentation time of the colony area image is reduced, which is beneficial to improving the segmentation efficiency of the colony area image. On the other hand, due to the cascade segmentation network, it will not be affected by manual intervention, which is beneficial to improving the reliability of the colony area image.
[0122] See also Figure 3 , Figure 3 yes Figure 2 A specific implementation flow diagram of step S23 is described in detail as follows:
[0123] S31, obtaining a model file, and loading the cascade segmentation network in the model file to obtain a loading result;
[0124] S32, when the loading result is successful, obtaining a preset rough semantic segmentation map and a preset background map, and inputting the processed original image, the background map and the rough semantic segmentation map into a cascade segmentation network.
[0125] In an embodiment of the present invention, the processed original image, the background image and the rough semantic segmentation image are input into a cascade segmentation network, and image segmentation is performed through the cascade segmentation network, which can significantly improve the accuracy and efficiency of the processed original image.
[0126] See also Figure 4 , Figure 4 yes Figure 2 A specific implementation flow diagram of step S25 is described in detail as follows:
[0127] S41, in the cascade segmentation network, selecting the next segmentation network of the initial segmentation network as the target segmentation network;
[0128] S42, obtaining an input instruction, executing the input instruction, and inputting the processed original image, the background image, and the initial segmentation result image into the target segmentation network.
[0129] In an embodiment of the present invention, the processed original image, the background image and the initial segmentation result image are input into the target segmentation network. The initial segmentation result image, as the output of preliminary processing, can provide the target segmentation network with valuable context information and a rough target outline, which is conducive to the target segmentation network focusing on the image area where the colony is located more quickly, reducing unnecessary computational overhead and improving segmentation efficiency.
[0130] See also Figure 5 , Figure 5 yes Figure 2 A specific implementation flow diagram of step S26 is described in detail as follows:
[0131] S51, concatenating the feature vector of the original image, the feature vector of the background image, and the feature vector of the initial segmentation result image to obtain a target feature vector, and processing the target feature vector through the target segmentation network to generate a target segmentation result image;
[0132] S52, when the target segmentation network is the last segmentation network, segment the image region where the colony is located from the processed original image according to the target segmentation result image, and select the image region where the colony is located as the colony region image.
[0133] The sequence number of the target segmentation network is obtained. When the sequence number of the target segmentation network is the sequence number of the last segmentation network, it indicates that the target segmentation network is the last segmentation network.
[0134] In an embodiment of the present invention, when the target segmentation network is the last segmentation network, the image area where the colony is located is segmented from the processed original image according to the target segmentation result map, and the image area where the colony is located is selected as the colony area image. Since no manual segmentation is required, the segmentation time of the colony area image is reduced, which is beneficial to improving the segmentation efficiency of the colony area image.
[0135] See also Figure 6 , Figure 6 FIG. 1 is a schematic diagram of a structure of a bacterial colony region image segmentation device according to an embodiment of the present invention. Figure 6As shown, the colony region image segmentation device includes a first acquisition module 101, a processing module 102, a second acquisition module 103, a generation module 104, an input module 105, and a segmentation module 106. The functional modules are described in detail as follows:
[0136] The first acquisition module 101 is used to acquire an original image of the bacterial colonies in the current culture dish taken by a camera;
[0137] The processing module 102 is used to pre-process the original image to obtain the processed original image;
[0138] A second acquisition module 103 is used to acquire a preset rough semantic segmentation map and a preset background map, and input the processed original image, the background map and the rough semantic segmentation map into a cascade segmentation network;
[0139] A generating module 104 is used to process the original image, the background image and the rough semantic segmentation image through the initial segmentation network in the cascade segmentation network to generate an initial segmentation result image;
[0140] An input module 105, used for inputting the processed original image, the background image and the initial segmentation result image into the target segmentation network, where the target segmentation network is the next segmentation network of the initial segmentation network;
[0141] The segmentation module 106 is used to process the processed original image, the background image and the initial segmentation result image through the target segmentation network to generate a target segmentation result image, and according to the target segmentation result image, segment the image area where the colony is located from the processed original image, and select the image area where the colony is located as the colony area image.
[0142] In the embodiment of the present invention, the beneficial effects lie in two aspects. On the one hand, the processed original image, the background image and the initial segmentation result image are processed through the target segmentation network to generate a target segmentation result image. According to the target segmentation result image, the image area where the colony is located is segmented from the processed original image, and the image area where the colony is located is selected as the colony area image. Since no manual segmentation is required, the segmentation time of the colony area image is reduced, which is beneficial to improving the segmentation efficiency of the colony area image. On the other hand, due to the cascade segmentation network, it will not be affected by manual intervention, which is beneficial to improving the reliability of the colony area image.
[0143] The specific limitations of the colony region image segmentation device can be found in the above limitations of the colony region image segmentation method, which will not be repeated here.
[0144] Each module in the above-mentioned colony region image segmentation device can be implemented in whole or in part by software, hardware and their combination. Each of the above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to each of the above modules.
[0145] See also Figure 7 , Figure 7 1 is another structural diagram of a computer device in one embodiment of the present invention. In one embodiment, a computer device is provided. The computer device is a server device or a client device. The internal structure diagram thereof can be as shown in FIG. Figure 7 As shown. The computer device includes a processor, a memory, a network interface, a display screen and an input device connected via a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface of the computer device is used to communicate with an external database. When the computer program is executed by the processor, the functions or steps of a colony area image segmentation method based on a cascade segmentation network can be implemented.
[0146] In one embodiment, a computer device is provided, comprising a memory, a processor, and a computer program stored on the memory and executable on the processor.
[0147] It should be noted that the above functions or steps that can be implemented by the computer-readable storage medium or computer device can refer to the relevant description of the aforementioned method embodiment. In order to avoid repetition, they will not be described one by one here.
[0148] The above-mentioned processor can be a general-purpose processor, including a central processing unit (CPU), a graphics processing unit (GPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components.
[0149] The above description and accompanying drawings fully illustrate the embodiments of the present disclosure so that those skilled in the art can practice them. Other embodiments may include structural, logical, electrical, process and other changes. The embodiments represent possible changes only. Unless explicitly required, separate components and functions are optional, and the order of operation may vary. Parts and subsamples of some embodiments may be included in or replace parts and subsamples of other embodiments. Moreover, the words used in this application are only used to describe the embodiments and are not used to limit the claims. As used in the description of the embodiments and claims, unless the context clearly indicates, the singular forms of "a", "an" and "the" are intended to include plural forms as well. Similarly, the term "and / or" as used in this application refers to any and all possible combinations of listings containing one or more associated ones. In addition, when used in the present application, the term "comprise" and its variants "comprises" and / or comprising refer to the presence of a stated sub-sample, whole, step, operation, element, and / or component, but do not exclude the presence or addition of one or more other sub-samples, wholes, steps, operations, elements, components and / or groups of these. In the absence of further restrictions, the elements defined by the sentence "comprising a ..." do not exclude the presence of other identical elements in the process, method or device comprising the elements. In this article, each embodiment may focus on the differences from other embodiments, and the same and similar parts between the various embodiments may refer to each other. For the methods, products, etc. disclosed in the embodiments, if they correspond to the method part disclosed in the embodiments, then the relevant parts can refer to the description of the method part.
[0150] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software may depend on the specific application and design constraints of the technical solution. Technicians can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the embodiments of the present disclosure. Technicians can clearly understand that for the convenience and simplicity of description, the specific working process of the above-described system, device and unit can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.
[0151] The flowchart and block diagram in the accompanying drawings show the possible architecture, function and operation of the system, method and computer program product according to the embodiment of the present disclosure. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of the code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. In some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, which can depend on the functions involved. In the description corresponding to the flowchart and the block diagram in the accompanying drawings, the operations or steps corresponding to different boxes can also occur in a different order from the order disclosed in the description, and sometimes there is no specific order between different operations or steps. For example, two consecutive operations or steps can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, which can depend on the functions involved. Each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, may be implemented by a dedicated hardware-based system that performs the specified functions or actions, or may be implemented by a combination of dedicated hardware and computer instructions.
Claims
1. A colony region image segmentation method based on a cascade segmentation network, characterized in that: include: Get the original image of the bacterial colonies in the current culture dish taken by the camera; Preprocessing the original image to obtain the processed original image; Obtaining a preset rough semantic segmentation map and a preset background map, and inputting the processed original image, the background map and the rough semantic segmentation map into a cascade segmentation network; The original image, the background image and the rough semantic segmentation image are processed by the initial segmentation network in the cascade segmentation network to generate an initial segmentation result image; Inputting the processed original image, the background image and the initial segmentation result image into the target segmentation network, wherein the target segmentation network is the next segmentation network of the initial segmentation network; The processed original image, the background image and the initial segmentation result image are processed through the target segmentation network to generate a target segmentation result image. According to the target segmentation result image, the image area where the colony is located is segmented from the processed original image, and the image area where the colony is located is selected as the colony area image.
2. The colony region image segmentation method according to claim 1, characterized in that: The preprocessing of the original image to obtain the processed original image includes: The original image is subjected to channel separation to obtain a single-channel image, a preset square structure element 1 is used to perform a bottom-hat transformation process on the single-channel image to obtain a first result image, and a preset square structure element 2 is used to perform a bottom-hat transformation process on the single-channel image to obtain a second result image; Performing morphological processing on the first result image and the second result image respectively to select a plurality of initial colony regions; The initial colony regions are combined to form a combined region, and the combined region is subjected to boundary operation to obtain a final target colony region, which is then marked on the original image.
3. The colony region image segmentation method according to claim 1, characterized in that: The step of obtaining a preset rough semantic segmentation map and a preset background map, and inputting the processed original image, the background map and the rough semantic segmentation map into a cascade segmentation network comprises: Obtaining a model file, and loading the cascade segmentation network in the model file to obtain a loading result; When the loading result is successful, a preset coarse semantic segmentation map and a preset background map are obtained, and the processed original image, the background map and the coarse semantic segmentation map are input into a cascade segmentation network.
4. The colony region image segmentation method according to claim 1, characterized in that: The process of processing the original image, the background image and the rough semantic segmentation image through the initial segmentation network in the cascade segmentation network to generate an initial segmentation result image includes: The feature vector of the original image, the feature vector of the background image and the feature vector of the rough semantic segmentation image are concatenated to obtain an initial feature vector; The initial feature vector is processed through the initial segmentation network to generate an initial segmentation result map.
5. The colony region image segmentation method according to claim 1, characterized in that: The step of inputting the processed original image, the background image and the initial segmentation result image into the target segmentation network comprises: In the cascade segmentation network, selecting a next segmentation network of the initial segmentation network as a target segmentation network; An input instruction is obtained, the input instruction is executed, and the processed original image, the background image and the initial segmentation result image are input into the target segmentation network.
6. The colony region image segmentation method according to claim 1, characterized in that: The method further comprises: processing the processed original image, the background image and the initial segmentation result image through the target segmentation network to generate a target segmentation result image; segmenting the image region where the colony is located from the processed original image according to the target segmentation result image; and selecting the image region where the colony is located as the colony region image, including: The feature vector of the original image, the feature vector of the background image and the feature vector of the initial segmentation result image are concatenated to obtain a target feature vector, and the target feature vector is processed by the target segmentation network to generate a target segmentation result image; When the target segmentation network is the last segmentation network, the image region where the colony is located is segmented from the processed original image according to the target segmentation result image, and the image region where the colony is located is selected as the colony region image.
7. The colony region image segmentation method according to claim 1, characterized in that: After the target segmentation network is used to process the processed original image, the background image and the initial segmentation result image to generate a target segmentation result image, the image region where the colony is located is segmented from the processed original image according to the target segmentation result image, and the image region where the colony is located is selected as the colony region image, the colony region image segmentation method includes: A push instruction is obtained, the push instruction is executed, and the colony area image is pushed to a target system.
8. The colony region image segmentation method according to claim 1, characterized in that: Before the acquisition camera captures the original image of the colonies in the current culture dish, the colony region image segmentation method includes: A sample image is obtained by taking a camera to capture a colony in a preset culture dish; Obtain the predicted segmentation result map generated by the cascade segmentation network based on the sample image, and calculate the loss value between the predicted segmentation result map and the true segmentation result map through the loss function; Adjusting the loss value by using the first weight value and the second weight value to obtain the adjusted loss value; When the adjusted loss value converges, the cascade segmentation network is saved.
9. A colony region image segmentation device based on a cascade segmentation network, characterized in that: include: The first acquisition module is used to acquire the original image of the bacterial colonies in the current culture dish taken by the camera; A processing module, used for preprocessing the original image to obtain the processed original image; A second acquisition module is used to acquire a preset rough semantic segmentation map and a preset background map, and input the processed original image, the background map and the rough semantic segmentation map into a cascade segmentation network; A generation module, used to process the original image, the background image and the rough semantic segmentation image through the initial segmentation network in the cascade segmentation network to generate an initial segmentation result image; An input module, used for inputting the processed original image, the background image and the initial segmentation result image into the target segmentation network, wherein the target segmentation network is the next segmentation network of the initial segmentation network; The segmentation module is used to process the processed original image, the background image and the initial segmentation result image through the target segmentation network to generate a target segmentation result image, and according to the target segmentation result image, segment the image area where the colony is located from the processed original image, and select the image area where the colony is located as the colony area image.
10. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the colony area image segmentation method according to any one of claims 1 to 8 are implemented.
Citation Information
Patent Citations
Optic disc segmentation method with combination of fundus image edge information and brightness information
CN106530316A
Visual detection method for slots on the surface of a bridge pier
CN109523479A
Bacterial colony segmentation counting method and system based on deep convolutional neural network
CN114202547A
X-ray image defect extraction method based on mathematical morphology method
CN116993659A
Techniques for determining dopaminergic neural cell loss using machine learning
WO2024073444A1