A method, system and device for automatic segmentation of cotton root system images

By adding a global attention mechanism module to the root segmentation model to optimize pixel characteristics, the problem of low accuracy of root segmentation in the existing technology is solved, and automatic and accurate segmentation of cotton roots in natural environments is realized.

CN116342882BActive Publication Date: 2025-04-29SHIHEZI UNIVERSITY
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310310220.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-03-24
Publication Date
2025-04-29
Estimated Expiration
2043-03-24

AI Technical Summary

Technical Problem

The existing root segmentation methods have shortcomings in accuracy, especially when there is interference noise in the soil environment, which affects the accuracy of automatic root segmentation.

Method used

The improved target context characterization network is adopted. The network adds a global attention mechanism module after the pixel features output by the backbone network. The pixel features are optimized through the global attention mechanism, and the model's attention to the root target is enhanced, thereby improving the ability to distinguish between root systems and backgrounds.

Benefits of technology

By adding a global attention mechanism module to the OCRNet model, the model's attention and segmentation accuracy of root system goals are significantly improved, and automatic and accurate segmentation of cotton root systems in natural environments is achieved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116342882B_ABST
    Figure CN116342882B_ABST
Patent Text Reader

Abstract

The present invention provides a method, system and device for automatic segmentation of cotton root images. The method comprises: obtaining cotton root images under natural conditions, and marking the roots in the cotton root images; performing data enhancement processing on the marked cotton root images to generate an enhanced cotton root image set; dividing the enhanced cotton root image set into a training set, a validation set and a test set; training an improved target context representation network according to the training set; the improved target context representation network is constructed by adding a global attention mechanism module after the pixel features output by the backbone network; inputting the cotton root image to be detected into the trained improved target context representation network, segmenting the roots of the cotton root image to be detected, and generating a root segmentation result. The present invention can realize automatic and accurate segmentation of cotton roots in a natural environment.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the field of automatic segmentation of root images, and in particular to a method, system and equipment for automatic segmentation of cotton root images. Background Art

[0002] The root system is the nutritional organ of the plant, usually located below the surface, responsible for absorbing water from the soil and dissolving inorganic salts therein, and has the functions of supporting, reproducing, storing and synthesizing organic matter. Therefore, the root system plays an important role in promoting plant growth, and root system research is an important basis for studying plant growth status. In root system research, root phenotypic parameters are an important measure of root growth. Traditionally, manual analysis of micro-root tube images is often used to obtain root phenotypic parameters, but this method will consume huge manpower and time costs, and automatic analysis using image processing technology is an ideal solution. In this process, plant root image segmentation has become a key task.

[0003] Many root segmentation researchers still use DeepLabv3+ and previous semantic segmentation models. As a model proposed in recent years, OCRNet uses the target area to which each pixel belongs as the area to extract context information, which is a better way to obtain context information for each pixel than DeepLabv3+. In addition, the background of the in-situ image is the real soil environment, and there are many noises in the soil that interfere with automatic root segmentation, which will affect the accuracy of automatic root segmentation. Summary of the invention

[0004] The purpose of the present invention is to provide a method, system and device for automatically segmenting cotton root images to solve the problem of low accuracy of existing root segmentation methods.

[0005] To achieve the above object, the present invention provides the following solutions:

[0006] A method for automatically segmenting cotton root system images, comprising:

[0007] Acquire a cotton root system image under natural conditions, and mark the roots in the cotton root system image;

[0008] Performing data enhancement processing on the annotated cotton root system images to generate an enhanced cotton root system image set;

[0009] Dividing the enhanced cotton root system image set into a training set, a validation set and a test set;

[0010] The improved target context representation network is trained according to the training set; the improved target context representation network is constructed by adding a global attention mechanism module after the pixel features output by the backbone network; the pixel features are cotton root system features;

[0011] The cotton root system image to be detected is input into the trained improved target context representation network, the root system of the cotton root system image to be detected is segmented, and the root system segmentation result of the cotton root system image to be detected is generated.

[0012] Optionally, the backbone network is a high-resolution network, and the high-resolution network specifically includes: four stages; at the end of each stage, the resolution of the feature map is reduced by downsampling to form a parallel low-resolution sub-network;

[0013] The first stage includes the same four residual units and a convolutional layer; the convolutional layer at the end of the first stage is used to reduce the number of channels of the feature map of the annotated cotton root image;

[0014] The second stage includes a switching module; the switching module includes 4 residual units and a cross-resolution switching unit; the switching module is used for multi-scale fusion;

[0015] The third stage includes 4 switching modules;

[0016] The fourth stage includes 3 switching modules.

[0017] Optionally, the improved target context representation network is trained according to the training set, and the method further includes:

[0018] The improved target context representation network is trained with hyperparameters; the hyperparameter setting includes setting a random cropping pipeline and calculating the loss using a cross entropy loss formula, and setting the background loss weight to 0.4444 and the root loss weight to 1; the random cropping pipeline is used to randomly crop the enhanced cotton root images in the training set before they are input into the improved target context representation network.

[0019] Optionally, the cross entropy loss formula Loss is:

[0020]

[0021] Where N is the number of pixels, y i is the label of pixel i, p i is the probability value of pixel i being predicted as the positive class.

[0022] Optionally, training the improved target context representation network according to the training set specifically includes:

[0023] Inputting the enhanced cotton root system image in the training set into the backbone network in the improved target context representation network, outputting pixel features, and inputting the pixel features into the global attention mechanism module in the improved target context representation network and the target region generator in the improved target context representation network respectively;

[0024] Utilizing the global attention mechanism module to optimize the pixel features and generate optimized pixel features;

[0025] Using the target region generator to generate a rough root system segmentation result according to the pixel features; the rough root system segmentation result is a soft target region;

[0026] Generate a target region feature according to the optimized pixel feature and the soft target region;

[0027] Generating a pixel-region relationship according to the target region feature and the optimized pixel feature;

[0028] Generate a target context feature according to the pixel-region relationship and the target region feature;

[0029] The target context feature and the optimized pixel feature are spliced ​​to generate an enhanced feature; the enhanced feature is a fine root segmentation result.

[0030] Optionally, the cotton root system image to be detected is input into the trained improved target context representation network, the root system of the cotton root system image to be detected is segmented, and a root system segmentation result of the cotton root system image to be detected is generated, and then the method further includes:

[0031] The intersection-over-union ratio and the Dice similarity coefficient are used as evaluation indicators to evaluate the segmentation effect of the root segmentation result of the improved target context representation network.

[0032] A cotton root system image automatic segmentation system, comprising:

[0033] A labeling module, used for acquiring a cotton root system image under natural conditions and labeling the root system in the cotton root system image;

[0034] An enhancement processing module is used to perform data enhancement processing on the annotated cotton root system images to generate an enhanced cotton root system image set;

[0035] A division module, used for dividing the enhanced cotton root system image set into a training set, a verification set and a test set;

[0036] An improved target context representation network training module is used to train the improved target context representation network according to the training set; the improved target context representation network is constructed by adding a global attention mechanism module to the pixel features output by the backbone network; the pixel features are cotton root system features;

[0037] The segmentation module is used to input the cotton root system image to be detected into the trained improved target context representation network, segment the roots of the cotton root system image to be detected, and generate a root system segmentation result of the cotton root system image to be detected.

[0038] Optional, improved target context representation network training module, specifically including:

[0039] An input unit, used for inputting the enhanced cotton root system image in the training set into the backbone network in the improved target context representation network;

[0040] The backbone network is used to output pixel features, and input the pixel features into the global attention mechanism module in the improved target context representation network and the target region generator in the improved target context representation network respectively;

[0041] The global attention mechanism module is used to optimize the pixel features and generate optimized pixel features;

[0042] The target region generator is used to generate a rough root system segmentation result according to the pixel features; the rough root system segmentation result is a soft target region;

[0043] A target region feature generating unit, configured to generate a target region feature according to the optimized pixel feature and the soft target region;

[0044] A pixel-region relationship generating unit, configured to generate a pixel-region relationship according to the target region feature and the optimized pixel feature;

[0045] A target context feature generating unit, configured to generate a target context feature according to the pixel-region relationship and the target region feature;

[0046] The enhanced feature generation unit is used to splice the target context feature and the optimized pixel feature to generate an enhanced feature; the enhanced feature is a fine root segmentation result.

[0047] An electronic device comprises a memory and a processor, wherein the memory is used to store a computer program, and the processor runs the computer program to enable the electronic device to execute the above-mentioned method for automatically segmenting cotton root system images.

[0048] A computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the above-mentioned method for automatically segmenting cotton root system images is implemented.

[0049] According to the specific embodiments provided by the present invention, the present invention discloses the following technical effects: the present invention provides a method, system and device for automatic segmentation of cotton root images, selects a high-resolution network as the backbone network of an object-contextual representation network (OCRNet), and adds a global attention mechanism module after the pixel features output by the backbone network to construct an improved target context representation network. Since the global attention mechanism (GAM) is an attention mechanism that focuses on the interaction of the three dimensions of width, height and number of channels of the feature map, it can effectively reduce information loss and amplify the features of global dimensional interaction; therefore, the present invention adds a GAM module to the OCRNet model to enhance the model's attention to the root target and improve the model's ability to distinguish the root from the background. The pixel features extracted by the backbone network are enhanced by the GAM module, thereby improving the network model's attention to the root target and realizing automatic and accurate segmentation of cotton roots in a natural environment. BRIEF DESCRIPTION OF THE DRAWINGS

[0050] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.

[0051] Figure 1 This is a flow chart of the method for automatically segmenting cotton root images provided by the present invention;

[0052] Figure 2 This is a diagram of the HRNetV2 network structure provided by the present invention.

[0053] Figure 3 This is an OCR module diagram of the improved OCRNet provided by 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 only 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] The purpose of the present invention is to provide a method, system and device for automatic segmentation of cotton root images, which can realize automatic and accurate segmentation of cotton roots in a natural environment.

[0056] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the present invention is further described in detail below with reference to the accompanying drawings and specific embodiments.

[0057] Embodiment 1

[0058] like Figure 1 As shown, the present invention provides a method for automatically segmenting cotton root images, comprising:

[0059] Step 101: Acquire a cotton root system image under natural conditions, and mark the roots in the cotton root system image.

[0060] In practical applications, micro-root tubes are used to obtain high-resolution cotton root images under natural conditions.

[0061] Step 102: performing data enhancement processing on the labeled cotton root system images to generate an enhanced cotton root system image set.

[0062] In practical applications, the high-resolution cotton root images acquired under natural conditions were annotated. At the same time, five methods, including increasing brightness, reducing brightness, proportional enlargement, proportional reduction, and adding salt and pepper noise, were used for data enhancement to expand the scale of the dataset.

[0063] Step 103: Divide the enhanced cotton root system image set into a training set, a validation set, and a test set.

[0064] In practical applications, the data set is divided into training set, validation set and test set in a ratio of 6:2:2.

[0065] Step 104: training an improved target context representation network according to the training set; the improved target context representation network is constructed by adding a global attention mechanism module to the pixel features output by the backbone network.

[0066] In practical applications, step 104 specifically includes: inputting the enhanced cotton root image in the training set into the backbone network in the improved target context representation network, outputting pixel features, and inputting the pixel features into the global attention mechanism module in the improved target context representation network and the target area generator in the improved target context representation network respectively; optimizing the pixel features using the global attention mechanism module to generate optimized pixel features; generating a rough root segmentation result based on the pixel features using the target area generator; the rough root segmentation result is a soft target area; generating a target area feature based on the optimized pixel features and the soft target area; generating a pixel-area relationship based on the target area feature and the optimized pixel feature; generating a target context feature based on the pixel-area relationship and the target area feature; splicing the target context feature and the optimized pixel feature to generate an enhanced feature; the enhanced feature is a fine root segmentation result.

[0067] In practical applications, the backbone network is a high-resolution network (HRNet), which specifically includes: four stages; at the end of each stage, the resolution of the feature map is reduced by downsampling to form a parallel low-resolution sub-network; the first stage includes the same four residual units and a convolutional layer; the convolutional layer at the end of the first stage is used to reduce the number of channels of the feature map of the labeled cotton root image; the second stage includes an exchange module; the exchange module includes four residual units and a cross-resolution exchange unit; the exchange module is used for multi-scale fusion; the third stage includes four exchange modules; the fourth stage includes three exchange modules.

[0068] As an optional implementation of the present invention, HRNetV2 is selected as the backbone network of OCRNet to extract the characteristics of cotton roots. Figure 2As shown in the figure, HRNetV2 is constructed in four stages. The first stage contains four residual units, each of which is the same as ResNet-50, consisting of a bottleneck layer with 64 channels, and then connected to a 3×3 convolution to reduce the number of channels of the feature map to C, C as the number of channels of the high-resolution sub-network in the last three stages. At the same time, at the end of each stage, the resolution of the feature map is reduced by half by downsampling to form a parallel low-resolution sub-network. The second, third, and fourth stages contain 1, 4, and 3 exchange modules respectively. Each exchange module includes four residual units and one cross-resolution exchange unit. The entire network includes a total of 8 exchange units, that is, 8 multi-scale fusions are performed, and then the output feature maps of the four resolution sub-networks in the last stage are spliced, making full use of the feature information of the feature map of each resolution sub-network.

[0069] As an optional implementation manner of the present invention, before step 104, it also includes: setting hyperparameters for network training of the improved target context representation network; the hyperparameter setting includes setting a random cropping pipeline and calculating the loss using the cross entropy loss formula, and setting the loss weight of the background to 0.4444, and setting the loss weight of the root system to 1; the random cropping pipeline is used to randomly crop the enhanced cotton root system image in the training set before it is input into the improved target context representation network.

[0070] Set the hyperparameters for network training: Set the random cropping pipeline so that the high-resolution original image is randomly cropped to a size of 512×512 pixels before entering the network.

[0071] The polynomial decay method is used to achieve the decay of the learning rate. The initial learning rate is set to 0.01, the power of the polynomial is set to 0.9, and the minimum learning rate is set to 0.0001.

[0072] In order to make the model converge better and the training more stable during training, the SGDM optimizer was used, the momentum was set to 0.9, and the weight decay exponent was set to 0.0005.

[0073] Set the training batch size to 4 and the total number of iterations to 40,000.

[0074] The loss is calculated using the cross entropy loss formula, which is as follows:

[0075]

[0076] Where N is the number of pixels, y i is the label of pixel i, p iis the probability value of pixel i being predicted as the positive class. Then, the loss weights of the background and root classes are set to 0.4444 and 1 respectively, solving the problem of unbalanced class distribution.

[0077] Step 105: input the cotton root system image to be detected into the trained improved target context representation network, segment the roots of the cotton root system image to be detected, and generate a root system segmentation result of the cotton root system image to be detected.

[0078] In practical applications, a global attention mechanism is added to OCRNet to improve the network model. Figure 3 As shown in the figure, in the main implementation module OCR of OCRNet, a GAM module is added after the pixel features output by the backbone network HRNetV2, so that the output of the GAM module replaces the original pixel features to participate in the calculation of target region features, pixel-region relationships and target context feature information, and enhances the model's ability to segment roots by increasing the model's attention to root targets. Among them, the target region generator is a fully convolutional network (FCN).

[0079] In practical applications, after step 105, the method further includes: using the intersection-over-union ratio and the Dice similarity coefficient as evaluation indicators to evaluate the segmentation effect of the root segmentation result of the improved target context representation network.

[0080] As an optional implementation of the present invention, the intersection over union (IoU) and Dice similarity coefficient (DCS) are used as evaluation indicators to evaluate the segmentation effect of the improved OCRNet model on high-resolution micro-root canal images.

[0081] During the training process, the total number of iterations is 40,000. The model weights are saved every 500 iterations and the evaluation indicators are tested once in the validation set. The model weights with the highest intersection-to-union ratio are selected to test the evaluation indicators in the test set to obtain the final network model evaluation results.

[0082] The calculation formula for the intersection over union (IoU) is as follows:

[0083]

[0084] Among them, TP represents true positives (regions predicted and annotated as root regions), FP represents false positives (regions predicted as root regions but annotated as background), and FN represents false negatives (regions predicted as background but annotated as root regions).

[0085] The Dice similarity coefficient DSC calculation formula is as follows:

[0086]

[0087] The present invention adds a global attention mechanism to OCRNet, which enhances the model's attention to root targets. Since GAM is an attention mechanism that focuses on the interaction of the three dimensions of width, height and number of channels of the feature map, it can effectively reduce information loss and amplify the features of global dimensional interaction. The pixel features output by the backbone network of OCRNet participate in the calculation many times in the entire OCRNet, which shows that the pixel features are closely related to the segmentation effect of OCRNet.

[0088] The present invention adds a GAM module after the pixel features output by the backbone network of OCRNet. The GAM module outputs optimized pixel features. The optimized pixel features reflect the model's higher attention to the root target. It replaces the original pixel features to participate in the calculation of target area features, pixel-area relationships and target context feature information, thereby enhancing the model's ability to segment the root system.

[0089] The improved OCRNet model proposed in the present invention realizes automatic and accurate segmentation of roots in soil, and performs excellently in the root segmentation task of high-resolution micro-root canal image dataset, wherein the intersection-over-union ratio reaches 84.26% and the Dice similarity coefficient reaches 91.46%.

[0090] Embodiment 2

[0091] In order to execute the method corresponding to the above-mentioned embodiment 1 and realize the corresponding functions and technical effects, a cotton root system automatic segmentation system is provided below.

[0092] A cotton root system image automatic segmentation system, comprising:

[0093] The marking module is used to obtain a cotton root system image under natural conditions and mark the roots in the cotton root system image.

[0094] The enhancement processing module is used to perform data enhancement processing on the labeled cotton root system images to generate an enhanced cotton root system image set.

[0095] The partitioning module is used to partition the enhanced cotton root system image set into a training set, a validation set and a test set.

[0096] The improved target context representation network training module is used to train the improved target context representation network according to the training set; the improved target context representation network is constructed by adding a global attention mechanism module to the pixel features output by the backbone network.

[0097] In practical applications, the improved target context representation network training module specifically includes: an input unit, which is used to input the enhanced cotton root image in the training set into the backbone network in the improved target context representation network; the backbone network is used to output pixel features, and input the pixel features into the global attention mechanism module in the improved target context representation network and the target area generator in the improved target context representation network respectively; the global attention mechanism module is used to optimize the pixel features and generate optimized pixel features; the target area generator is used to generate a rough root segmentation result according to the pixel features; the rough root segmentation result is a soft target area; a target area feature generation unit is used to generate a target area feature according to the optimized pixel features and the soft target area; a pixel-area relationship generation unit is used to generate a pixel-area relationship according to the target area feature and the optimized pixel feature; a target context feature generation unit is used to generate a target context feature according to the pixel-area relationship and the target area feature; an enhanced feature generation unit is used to splice the target context feature and the optimized pixel feature to generate an enhanced feature; the enhanced feature is a fine root segmentation result.

[0098] The segmentation module is used to input the cotton root system image to be detected into the trained improved target context representation network, segment the roots of the cotton root system image to be detected, and generate a root system segmentation result of the cotton root system image to be detected.

[0099] The present invention can realize automatic and accurate segmentation of cotton root systems in a natural environment.

[0100] The present invention adds a global attention mechanism to the OCRNet semantic segmentation network model to enhance the OCRNet model's attention to the root target, thereby improving the accuracy of cotton root segmentation.

[0101] The present invention uses the cross entropy loss formula to calculate the loss in the network training process of improving OCRNet, and sets the loss weights of the background and root categories to 0.4444 and 1 respectively, solving the problem of unbalanced category distribution.

[0102] The improved OCRNet of the present invention can load the existing pre-trained weights without additional cost, thereby accelerating the convergence speed of network training.

[0103] The present invention adopts the intersection-over-union ratio and Dice similarity coefficient to evaluate the cotton root segmentation effect of the improved OCRNet model, and more carefully distinguishes the quality of the method.

[0104] The present invention sets a random cropping pipeline, so that the high-resolution cotton root system original image is randomly cropped into a specification of 512×512 pixels before being input into the network during network training, so that the cotton root system image can be input into the network model for training within the GPU memory limit, and the details of the cotton root system in the high-resolution image can be retained.

[0105] The present invention creates a dataset of high-resolution cotton root images collected using micro-root tubes and annotated.

[0106] Embodiment 3

[0107] An embodiment of the present invention provides an electronic device including a memory and a processor, wherein the memory is used to store a computer program, and the processor runs the computer program to enable the electronic device to execute the method for automatically segmenting cotton root images provided in the first embodiment.

[0108] In practical applications, the above electronic device may be a server.

[0109] In practical applications, an electronic device includes: at least one processor, a memory, a bus and a communications interface.

[0110] Wherein: the processor, the communication interface, and the memory communicate with each other via a communication bus.

[0111] Communication interface, used to communicate with other devices.

[0112] The processor is used to execute the program, and specifically can execute the method described in the above embodiment.

[0113] Specifically, the program may include program codes including computer operation instructions.

[0114] The processor may be a central processing unit (CPU), or an application specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present invention. The one or more processors included in the electronic device may be processors of the same type, such as one or more CPUs; or processors of different types, such as one or more CPUs and one or more ASICs.

[0115] The memory is used to store programs. The memory may include a high-speed RAM memory, and may also include a non-volatile memory, such as at least one disk memory.

[0116] Based on the description of the above embodiments, an embodiment of the present application provides a storage medium on which computer program instructions are stored. The computer program instructions can be executed by a processor to implement the method described in any embodiment.

[0117] The cotton root system image automatic segmentation system provided in the embodiment of the present application exists in various forms, including but not limited to:

[0118] (1) Mobile communication devices: These devices are characterized by their mobile communication functions and their main purpose is to provide voice and data communications. These terminals include: smart phones (such as iPhone), multimedia phones, functional phones, and low-end phones.

[0119] (2) Ultra-mobile personal computer devices: These devices fall into the category of personal computers, have computing and processing capabilities, and generally also have mobile Internet access capabilities. These terminals include: PDA, MID and UMPC devices, such as iPad.

[0120] (3) Portable entertainment devices: These devices can display and play multimedia content. They include audio and video players (such as iPods), handheld game consoles, e-books, smart toys, and portable car navigation devices.

[0121] (4) Other electronic devices with data interaction functions.

[0122] Thus far, specific embodiments of the subject matter have been described. Other embodiments are within the scope of the appended claims. In some cases, the actions recited in the claims may be performed in a different order and still achieve the desired results. Additionally, the processes depicted in the accompanying drawings do not necessarily require the specific order or sequential order shown to achieve the desired results. In some embodiments, multitasking and parallel processing may be advantageous.

[0123] The systems, devices, modules or units described in the above embodiments may be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer. Specifically, the computer may be, for example, a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.

[0124] For the convenience of description, the above device is described by being divided into various units according to their functions and described separately. Of course, when implementing the present application, the functions of each unit can be implemented in the same one or more software and / or hardware. It should be understood by those skilled in the art that the embodiments of the present application can be provided as methods, systems or computer program products. Therefore, the present application can adopt the form of a complete hardware embodiment, a complete software embodiment or an embodiment combining software and hardware. Moreover, the present application can adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.

[0125] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems) and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0126] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0127] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0128] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.

[0129] The memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.

[0130] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape, disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.

[0131] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.

[0132] The present application may be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific transactions or implement specific abstract data types. The present application may also be practiced in distributed computing environments where transactions are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules may be located in local and remote computer storage media, including storage devices.

[0133] In this specification, each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the system disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part.

[0134] The principles and implementation methods of the present invention are described in this article using specific examples. The description of the above embodiments is only used to help understand the method and core idea of ​​the present invention. At the same time, for those skilled in the art, according to the idea of ​​the present invention, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as limiting the present invention.

Claims

1. A method for automatic segmentation of cotton root images, characterized in that: include: Acquire a cotton root system image under natural conditions, and mark the roots in the cotton root system image; Performing data enhancement processing on the annotated cotton root system images to generate an enhanced cotton root system image set; Dividing the enhanced cotton root system image set into a training set, a validation set and a test set; Training the improved target context representation network according to the training set specifically includes: Inputting the enhanced cotton root system image in the training set into the backbone network in the improved target context representation network, outputting pixel features, and inputting the pixel features into the global attention mechanism module in the improved target context representation network and the target region generator in the improved target context representation network respectively; Utilizing the global attention mechanism module to optimize the pixel features and generate optimized pixel features; The target region generator is used to generate a rough root segmentation result according to the pixel features; the rough root segmentation result is a soft target region; the target region generator is a fully convolutional network; Generate a target region feature according to the optimized pixel feature and the soft target region; Generating a pixel-region relationship according to the target region feature and the optimized pixel feature; Generate a target context feature according to the pixel-region relationship and the target region feature; The target context feature and the optimized pixel feature are spliced ​​to generate an enhanced feature; the enhanced feature is a fine root segmentation result; the improved target context representation network is constructed by adding a global attention mechanism module after the pixel feature output by the backbone network; the pixel feature is a cotton root feature; the backbone network is a high-resolution network, and the high-resolution network specifically includes: four stages; at the end of each stage, the resolution of the feature map is reduced by downsampling to form a parallel low-resolution sub-network; The first stage includes the same four residual units and a convolutional layer; the convolutional layer at the end of the first stage is used to reduce the number of channels of the feature map of the annotated cotton root image; The second stage includes a switching module; the switching module includes 4 residual units and a cross-resolution switching unit; the switching module is used for multi-scale fusion; The third stage includes 4 switching modules; The fourth stage includes 3 switching modules; The cotton root system image to be detected is input into the trained improved target context representation network, the root system of the cotton root system image to be detected is segmented, and the root system segmentation result of the cotton root system image to be detected is generated.

2. The method for automatic segmentation of cotton root images according to claim 1, characterized in that: The improved target context representation network is trained according to the training set, and the previous steps include: The improved target context representation network is trained with hyperparameters; the hyperparameter setting includes setting a random cropping pipeline and calculating the loss using a cross entropy loss formula, and setting the background loss weight to 0.4444 and the root loss weight to 1; the random cropping pipeline is used to randomly crop the enhanced cotton root images in the training set before they are input into the improved target context representation network.

3. The method for automatic segmentation of cotton root images according to claim 2, characterized in that: The cross entropy loss formula Loss is: Where N is the number of pixels, y i is the label of pixel i, p i is the probability value of pixel i being predicted as the positive class.

4. The method for automatic segmentation of cotton root images according to claim 1, characterized in that: Inputting the cotton root system image to be detected into the trained improved target context representation network, segmenting the root system of the cotton root system image to be detected, and generating a root system segmentation result of the cotton root system image to be detected, and then further comprising: The intersection-over-union ratio and the Dice similarity coefficient are used as evaluation indicators to evaluate the segmentation effect of the root segmentation result of the improved target context representation network.

5. A cotton root system automatic segmentation system, characterized in that: The cotton root system image automatic segmentation system adopts the cotton root system image automatic segmentation method according to any one of claims 1 to 4, and the cotton root system image automatic segmentation system comprises: A labeling module, used for acquiring a cotton root system image under natural conditions and labeling the root system in the cotton root system image; An enhancement processing module is used to perform data enhancement processing on the annotated cotton root system images to generate an enhanced cotton root system image set; A division module, used for dividing the enhanced cotton root system image set into a training set, a verification set and a test set; An improved target context representation network training module is used to train the improved target context representation network according to the training set; the improved target context representation network is constructed by adding a global attention mechanism module to the pixel features output by the backbone network; the pixel features are cotton root system features; The segmentation module is used to input the cotton root system image to be detected into the trained improved target context representation network, segment the roots of the cotton root system image to be detected, and generate a root system segmentation result of the cotton root system image to be detected.

6. The cotton root system automatic segmentation system according to claim 5, characterized in that: The improved target context representation network training module includes: An input unit, used for inputting the enhanced cotton root system image in the training set into the backbone network in the improved target context representation network; The backbone network is used to output pixel features, and input the pixel features into the global attention mechanism module in the improved target context representation network and the target region generator in the improved target context representation network respectively; The global attention mechanism module is used to optimize the pixel features and generate optimized pixel features; The target region generator is used to generate a rough root system segmentation result according to the pixel features; the rough root system segmentation result is a soft target region; A target region feature generating unit, configured to generate a target region feature according to the optimized pixel feature and the soft target region; A pixel-region relationship generating unit, configured to generate a pixel-region relationship according to the target region feature and the optimized pixel feature; A target context feature generating unit, configured to generate a target context feature according to the pixel-region relationship and the target region feature; The enhanced feature generation unit is used to splice the target context feature and the optimized pixel feature to generate an enhanced feature; the enhanced feature is a fine root segmentation result.

7. An electronic device, characterized in that: The electronic device comprises a memory and a processor, wherein the memory is used to store a computer program, and the processor runs the computer program to enable the electronic device to execute the method for automatic segmentation of cotton root system images according to any one of claims 1 to 4.

8. A computer-readable storage medium, characterized in that: The computer program is stored therein, and when the computer program is executed by a processor, the method for automatically segmenting cotton root system images according to any one of claims 1 to 4 is implemented.