Image segmentation method, device, equipment and storage medium with reduced volatility
Through encoder downsampling, arrangement, splicing and cascading hollow convolution layer feature extraction, and then upsampling by the decoder, the problem of segmentation results caused by input image movement in deep learning methods is solved, and the stability and translation equality of the image segmentation network are achieved.
Patent Information
- Application Number
- CN202310223699.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-09
- Publication Date
- 2025-08-15
- Estimated Expiration
- 2043-03-09
AI Technical Summary
In industrial defect detection, the existing deep learning methods have not effectively solved the volatility problem of network segmentation results when input images are moved, which affects the stability and translation equality of segmentation results.
The input image is downsampled by an encoder, the spatial slices are arranged and spliced according to the preset arrangement rules, the feature extraction is performed using the cascading hollow convolution layer, and the decoder is upsampled to obtain the segmented image.
It improves the robustness of the image segmentation network, ensures the stability and translation equality of the segmentation results of the input image when there is a small amount of movement, and meets the stability requirements for the segmentation network in industrial scenarios.
Smart Images

Figure CN117197152B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of image processing technology, and in particular to an image segmentation method, device, equipment and storage medium for reducing volatility. Background Art
[0002] Due to mechanical or human factors, industrial products often develop surface defects during the production process. Consequently, most manufacturers invest significant manpower in product quality inspection. However, the human eye's accuracy and working time are limited. With the continuous advancement of machine vision technology and the demand for faster production lines and more diverse products in the Industry 4.0 process, machine vision has demonstrated tremendous potential in industrial product quality inspection. Traditional machine vision algorithms require manual feature design, making it difficult to model and transfer defect features. Furthermore, they often need to distinguish between different operating conditions, which results in limited algorithm versatility and significant labor costs. Deep neural networks enable end-to-end feature extraction, and their powerful feature extraction capabilities are widely used in surface defect detection.
[0003] While current deep learning methods can significantly improve the performance of surface defect segmentation, the fluctuation of network segmentation results caused by input image movement has not been addressed. Even a small pixel shift in the input image can significantly affect the network's segmentation results. However, ensuring the stability of segmentation results when the input image is shifted by a small amount is crucial in industrial defect detection. Therefore, achieving translational equality of segmentation results in defect segmentation networks for industrial scenarios has become an urgent need. In recent years, the translational invariance and equality of deep neural networks in non-industrial settings have received considerable attention. While data augmentation can reduce network volatility during training, generalization performance on test data is limited. Similarly, in some classification networks, a single pixel shift can cause a 30% confidence level fluctuation. Global average pooling has been shown to improve translational invariance in classification networks. For segmentation networks, which ultimately need to classify every pixel, ideally, the network should achieve translational equality, meaning that a pixel shift in the input image results in a corresponding pixel shift in the predicted output image. Similarly, some scholars have proposed slicing the spatial dimension and retaining the component with the largest norm to achieve downsampling, and upsampling by restoring the spatial components at the corresponding positions, which ultimately effectively alleviates the fluctuation of the segmentation results caused by the translation of the input image on the segmentation network. In addition, similar scholars have proposed using a small neural network to select components when slicing the spatial dimension, so as to achieve an adaptive effect and ensure the translation equality of the segmentation network under circular shifts. However, both methods alleviate the fluctuation of the network at the expense of a certain degree of accuracy, and cannot guarantee complete translation equality in ordinary translations, that is, in actual scenarios. Summary of the Invention
[0004] In view of this, the present invention provides an image segmentation method, apparatus, device and storage medium for reducing volatility. The main purpose is to ensure that the volatility of the result segmented by the segmentation network is small when the input image moves a small amount, so that the translation equality of the segmentation network is well maintained.
[0005] According to a first aspect of the present invention, there is provided an image segmentation method for reducing volatility, comprising:
[0006] Get the input image;
[0007] Downsampling the input image using an encoder to obtain spatial slices;
[0008] Arranging and splicing the spatial slices according to a preset arrangement rule to obtain spliced slices;
[0009] Performing feature extraction on the spliced slices according to the cascaded dilated convolutional layers to obtain a downsampled feature map;
[0010] A decoder is used to upsample the downsampled feature map to obtain a segmented image.
[0011] According to a second aspect of the present invention, there is provided an image acquisition module for acquiring an input image;
[0012] A downsampling processing module, configured to downsample the input image using an encoder to obtain spatial slices;
[0013] A splicing module, configured to arrange and splice the spatial slices according to a preset arrangement rule to obtain spliced slices;
[0014] A feature extraction module, configured to extract features from the spliced slices according to the cascaded dilated convolutional layers to obtain a downsampled feature map;
[0015] The upsampling processing module is used to use a decoder to perform upsampling processing on the downsampled feature map to obtain a segmented image.
[0016] According to a third aspect of the present invention, a computer-readable storage medium is provided, on which a computer program is stored, characterized in that when the computer program is executed by a processor, the steps of the method described above are implemented.
[0017] According to a fourth aspect of the present invention, a computer device is provided, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program implements the steps of the method described above when executed by the processor.
[0018] By means of the above technical solution, the technical solution provided by the embodiment of the present invention has at least the following advantages:
[0019] The present invention provides a method, apparatus, device, and storage medium for image segmentation that reduces volatility. Compared with the prior art, the present invention uses an encoder to downsample the input image to obtain spatial slices; then arranges and splices the spatial slices according to a preset arrangement rule to obtain spliced slices; then extracts features from the spliced slices using a cascaded dilated convolutional layer to obtain a downsampled feature map; and finally, uses a decoder to upsample the downsampled feature map to obtain a segmented image. The method provided by the present invention can improve the robustness of the input image in the segmentation network, ensuring that the volatility of the segmentation results obtained by the segmentation network when the input image moves slightly is small, thereby well maintaining the translation equality of the segmentation network, and thus enhancing the stability of image segmentation when the input image is slightly translated, thereby meeting the requirements of industrial scenarios for high stability of the segmentation network and low pass and miss rates of defect detection. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] Various other advantages and benefits will become apparent to those skilled in the art upon reading the detailed description of the preferred embodiment below. The accompanying drawings are for illustration purposes only and are not to be considered as limiting the present invention. The same reference symbols are used throughout the drawings to represent the same components. In the drawings:
[0021] Figure 1 A schematic diagram showing an application scenario of an image segmentation method for reducing volatility provided by an embodiment of the present invention is shown;
[0022] Figure 2 A flow chart of an image segmentation method for reducing volatility provided by an embodiment of the present invention is shown;
[0023] Figure 3 A flow chart of another image segmentation method for reducing volatility provided by an embodiment of the present invention is shown;
[0024] Figure 4 shows a structural diagram of a segmentation network provided by an embodiment of the present invention;
[0025] Figure 5 A schematic diagram of a Focus_attention module provided by an embodiment of the present invention is shown;
[0026] Figure 6 A schematic diagram of the structure of the ECA channel attention module provided by an embodiment of the present invention is shown;
[0027] Figure 7 A structural block diagram of an image segmentation device for reducing volatility provided by an embodiment of the present invention is shown;
[0028] Figure 8It is a block diagram of an electronic device for implementing the method according to an embodiment of the present invention. DETAILED DESCRIPTION
[0029] Exemplary embodiments will be described in detail herein, examples of which are illustrated in the accompanying drawings. In the following description, when referring to the drawings, like numbers in different figures represent like or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments are not intended to represent all possible embodiments consistent with the present invention. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present invention, as detailed in the appended claims.
[0030] The terms used in this invention are for the purpose of describing specific embodiments only and are not intended to limit the invention. The singular forms "a," "the," and "the" used in this invention and the appended claims are also intended to include plural forms unless the context clearly indicates otherwise. It should also be understood that the term "and / or" as used herein refers to and includes any or all possible combinations of one or more of the associated listed items.
[0031] It should be understood that although the terms "first," "second," "third," etc. may be used in the present invention to describe various information, such information should not be limited to these terms. These terms are merely used to distinguish information of the same type from one another. For example, first information may also be referred to as second information, and similarly, second information may also be referred to as first information, without departing from the scope of the present invention. Depending on the context, the term "if" as used herein may be interpreted as "when," "when," or "in response to determining."
[0032] The embodiments of the present disclosure will be described in detail below with reference to the accompanying drawings.
[0033] Figure 1 FIG2 is a schematic diagram of an exemplary system 100 in which the various methods and apparatuses described herein may be implemented according to an embodiment of the present disclosure. Figure 1 , the system 100 includes one or more client devices 101, 102, 103, 104, 105, and 106, a server 120, and one or more communication networks 110 coupling the one or more client devices to the server 120. The client devices 101, 102, 103, 104, 105, and 106 can be configured to execute one or more applications.
[0034] In an embodiment of the present disclosure, the server 120 may run one or more services or software applications that enable execution of the image segmentation method for reducing volatility.
[0035] In some embodiments, server 120 may also provide other services or software applications that may include non-virtualized environments and virtualized environments. In some embodiments, these services may be provided as web-based services or cloud services, such as provided to users of client devices 101, 102, 103, 104, 105, and / or 106 under a software as a service (SaaS) model.
[0036] exist Figure 1 In the configuration shown, the server 120 may include one or more components that implement the functions performed by the server 120. These components may include software components, hardware components, or a combination thereof that can be executed by one or more processors. Users operating client devices 101, 102, 103, 104, 105, and / or 106 may, in turn, utilize one or more client applications to interact with the server 120 to utilize the services provided by these components. It should be understood that a variety of different system configurations are possible, which may differ from the system 100. Therefore, Figure 1 is one example of a system for implementing the various methods described herein and is not intended to be limiting.
[0037] The user may use client devices 101, 102, 103, 104, 105 and / or 106 to receive the first classification result. The client device may provide an interface that enables the user of the client device to interact with the client device. The client device may also output information to the user via the interface. Figure 1 Only six client devices are depicted, but one skilled in the art will appreciate that the present disclosure can support any number of client devices.
[0038] Client devices 101, 102, 103, 104, 105, and / or 106 may include various types of computer devices, such as portable handheld devices, general-purpose computers (such as personal computers and laptops), workstation computers, wearable devices, smart screen devices, self-service terminal devices, service robots, gaming systems, thin clients, various messaging devices, sensors or other sensing devices, etc. These computer devices may run various types and versions of software applications and operating systems, such as Microsoft Windows, Apple iOS, UNIX-like operating systems, Linux, or Linux-like operating systems (such as Google Chrome OS); or include various mobile operating systems, such as Microsoft Windows Mobile OS, iOS, Windows Phone, and Android. Portable handheld devices may include cellular phones, smartphones, tablet computers, personal digital assistants (PDAs), etc. Wearable devices may include head-mounted displays (such as smart glasses) and other devices. Gaming systems may include various handheld gaming devices, internet-enabled gaming devices, etc. Client devices are capable of executing a variety of different applications, such as various internet-related applications, communication applications (such as email applications), and short message service (SMS) applications, and may use various communication protocols.
[0039] The network 110 may be any type of network known to those skilled in the art that can support data communications using any of a variety of available protocols, including but not limited to TCP / IP, SNA, IPX, etc. By way of example only, the one or more networks 110 may be a local area network (LAN), an Ethernet-based network, a token ring, a wide area network (WAN), the Internet, a virtual network, a virtual private network (VPN), an intranet, an extranet, a public switched telephone network (PSTN), an infrared network, a wireless network (e.g., Bluetooth, WIFI), and / or any combination of these and / or other networks.
[0040] Server 120 may include one or more general-purpose computers, specialized server computers (e.g., PC (personal computer) servers, UNIX servers, mid-range servers), blade servers, mainframe computers, server clusters, or any other suitable arrangement and / or combination. Server 120 may include one or more virtual machines running virtual operating systems, or other computing architectures involving virtualization (e.g., one or more flexible pools of logical storage devices that may be virtualized to maintain a server's virtual storage device). In various embodiments, server 120 may run one or more services or software applications that provide the functionality described below.
[0041] The computing units in the server 120 may run one or more operating systems including any of the operating systems described above as well as any commercially available server operating systems. The server 120 may also run any of a variety of additional server applications and / or middle-tier applications, including HTTP servers, FTP servers, CGI servers, JAVA servers, database servers, and the like.
[0042] In some implementations, server 120 may include one or more applications to analyze and consolidate data feeds and / or event updates received from users of client devices 101, 102, 103, 104, 105, and 106. Server 120 may also include one or more applications to display the data feeds and / or real-time events via one or more display devices of client devices 101, 102, 103, 104, 105, and 106.
[0043] In some embodiments, server 120 may be a distributed system server or a server integrated with blockchain. Server 120 may also be a cloud server, or an intelligent cloud computing server or intelligent cloud host equipped with artificial intelligence technology. A cloud server is a host product within the cloud computing service system that addresses the management difficulties and poor scalability of traditional physical hosts and virtual private servers (VPS) services.
[0044] The system 100 may also include one or more databases 130. In some embodiments, these databases can be used to store data and other information. For example, one or more of the databases 130 can be used to store information such as audio files and object files. The data repository 130 can reside in a variety of locations. For example, the data repository used by the server 120 can be local to the server 120, or can be remote from the server 120 and can communicate with the server 120 via a network-based or dedicated connection. The data repository 130 can be of different types. In some embodiments, the data repository used by the server 120 can be a database, such as a relational database. One or more of these databases can store, update, and retrieve data to and from the database in response to commands.
[0045] In some embodiments, one or more of the databases 130 may also be used by applications to store application data. The databases used by the applications may be different types of databases, such as a key-value store, an object store, or a conventional store backed by a file system.
[0046] Figure 1The system 100 may be configured and operated in various ways to enable application of the various methods and apparatuses described in accordance with the present disclosure.
[0047] This embodiment provides an image segmentation method that reduces volatility, such as Figure 2 As shown, the method 200 includes the following steps:
[0048] 201. Obtain an input image.
[0049] The present application performs image segmentation with reduced volatility on an input image based on a segmentation network, which includes an encoder and a decoder. Here, the segmentation network may include but is not limited to detection of scenes such as mobile phone screens, clothing surfaces, and ceramic surfaces in industrial scenes. The input image is a pixel-level input image, and here, the image content of the pixel-level input image may include images with various scene contents, such as: mobile phone screen images, clothing surface images, ceramic surface images, cloth surfaces, etc.; accordingly, the segmentation result is a pixel-level segmentation result. The segmentation network can also be used in the field of image segmentation in other scenes, which is not limited in this embodiment.
[0050] Here, the dataset used for training the segmentation network may include, but is not limited to, mobile phone screen defects, cloth surface defects, and ceramic surfaces. When the input image is fed into the segmentation network, the input image is annotated at the pixel level, and the annotated result is converted into a groundtruth in PNG format. The segmentation network in this application is integrated into specific deep learning frameworks such as TensorFlow, Caffe, and PyTorch. In addition, a standard 128×128 image can be cropped from some large images according to a certain translation rule as the input image, ensuring that the same defect remains in the image and not near the edge. It can be verified that the network in this application has little effect on the defect segmentation results under different translations, and the translation equality of the segmentation network can be basically guaranteed.
[0051] 202. Use an encoder to downsample the input image to obtain spatial slices.
[0052] It should be noted that, here, the input image is downsampled by the Focus module to obtain spatial slices. The convolution operation with a stride of 1 (including hole convolution) can ensure the translation equality of the segmentation network. The main reason for destroying the translation equality of the segmentation network is the downsampling or convolution with a stride of 2. At the same time, the artificial edges introduced by the padding operation and the new edges caused by the translation of the input image will also affect the image. Changing these effects will tend more and more to the center of the feature map as the number of downsampling increases. Therefore, the more times the input image is downsampled, the greater the fluctuation of the segmentation results of the segmentation network for defects. Here, the present application minimizes the use of downsampling layers through the segmentation network, and uses hole convolution to increase the receptive field of the network, so that the segmentation network of the present application only uses the Focus module for downsampling once, and obtains a twice-downsampled feature map without feature loss. The traditional Maxpool layer is not used to downsample the input image to reduce the volatility of the segmentation results of the segmentation network for input images with industrial defects.
[0053] 203. Arrange and splice the spatial slices according to a preset arrangement rule to obtain spliced slices.
[0054] Here, the spatial slices are rearranged and spliced according to the preset arrangement rules to ensure that the features at the end of the encoder are only shifted in spatial position, ensuring the translation equality of the network structure.
[0055] 204. Feature extraction is performed on the spliced slices according to the cascaded dilated convolutional layers to obtain a downsampled feature map.
[0056] It should be noted that after the spatial slices are arranged and spliced, in order to further extract features, cascaded dilated convolution layers are used in the encoder to continuously increase the receptive field. For example, the network has a total of 8 dilated convolution layers, and the dilation rate is set to a sawtooth cycle structure of [1, 2, 5, 7, 1, 2, 5, 7] to avoid the grid effect. The number of convolution kernels is set to [64, 256, 256, 128, 128, 64, 64, 4], with a size of 3. Each layer of dilated convolution is followed by a BatchNormalization layer and a ReLU activation function. Among them, the number of dilated convolution kernels in the last layer is set to 4 to perform the Unfocus operation, that is, to restore the spatial resolution of the original image by upsampling in the subsequent steps. This process is the inverse of the Focus process, treating the downsampled feature map as a spatial slice and restoring it to the original spatial position.
[0057] Here, it should also be noted that the role of traditional downsampling methods such as Maxpool is to increase the receptive field of the network to extract deeper features of the image, but this method will cause the loss of translation equality of the segmentation network. Although the ordinary convolution operation with a stride of 1 has translation equality, if the same receptive field needs to be obtained by ordinary convolution, it is necessary to stack deeper layers than the dilated convolution, which makes the model too complicated. Therefore, the present invention uses cascaded dilated convolution layers to achieve a larger image receptive field by using fewer network layers, and extracts deeper global features, so as to extract deep features of the image and improve network performance; at the same time, the translation equality of the dilated convolution itself can also make the volatility of the segmentation result smaller, thereby ensuring the translation invariance of the input features.
[0058] 205. Use a decoder to upsample the downsampled feature map to obtain a segmented image.
[0059] It should be noted that the Unfocus module is used to upsample the downsampled feature map to obtain the segmented image, wherein the Unfocus module here can perform an inverse operation on the downsampled feature map obtained after the Focus module processes the input image to obtain the segmented image.
[0060] This embodiment provides a method for image segmentation with reduced volatility. The method employs an encoder to downsample an input image to obtain spatial slices; the spatial slices are then arranged and spliced according to a preset arrangement rule to obtain spliced slices; the spliced slices are then subjected to feature extraction using a cascade of dilated convolutional layers to obtain a downsampled feature map; and finally, a decoder is used to upsample the downsampled feature map to obtain a segmented image. The method provided by the present invention can improve the robustness of the input image in the segmentation network, ensuring that the segmentation results obtained by the segmentation network have low volatility when the input image is slightly shifted. This in turn effectively maintains the translation equality of the segmentation network, thereby enhancing the stability of image segmentation when the input image is slightly shifted.
[0061] Furthermore, as a refinement and extension of the specific implementation of the above embodiment, in order to fully illustrate the specific implementation process of this embodiment, this embodiment provides another image segmentation method that reduces volatility, such as Figure 3 As shown, the method 300 includes the following steps:
[0062] 301. Obtain an input image.
[0063] It should be noted that the encoder includes a Focus_attention module and a cascaded dilated convolutional layer. The specific structure of the Focus_attention module can be found in Figure 4, which includes a Focus module and an ECA module, and the decoder includes an Unfocus module.
[0064] 302. Use the Focus module in the encoder to downsample the input image to obtain spatial slices.
[0065] It should be noted that the convolution operation with a stride of 1 (including dilated convolution) can ensure the translation equality of the segmentation network. The main reason for destroying the translation equality of the segmentation network is the downsampling or convolution with a stride of 2. At the same time, the artificial edges introduced by the padding operation and the new edges caused by the translation of the input image will also affect the image. Changing these effects will tend more and more to the center of the feature map as the number of downsampling increases. Therefore, the more times the input image is downsampled, the greater the fluctuation of the segmentation results of the segmentation network for defects. Here, the present application minimizes the use of downsampling layers through the segmentation network and uses dilated convolution to increase the receptive field of the network, so that the segmentation network of the present application only uses the Focus module for downsampling once, and obtains a twice-downsampled feature map without feature loss. The traditional Maxpool layer is not used to downsample the input image to reduce the volatility of the segmentation results of the segmentation network for input images with industrial defects.
[0066] In some embodiments, before downsampling the input image using the Focus module in the encoder to obtain spatial slices, the method may further include: performing low-pass filtering on the input image using a preset Gaussian kernel to obtain the input image after low-pass filtering.
[0067] Here, a Gaussian kernel of size 3 is used, such as Figure 5 The Gaussian blur in the low-pass filtering process of the input image can alleviate the spectrum aliasing caused by the violation of the sampling theorem due to downsampling as much as possible, so as to slow down the loss of translation equality of the segmentation network caused by downsampling.
[0068] In other embodiments, downsampling the input image using the Focus module in the encoder to obtain spatial slices may include: according to a preset spatial resolution, using the Focus module in the encoder to equally slice the input image in the spatial dimension to obtain spatial slices with a preset spatial resolution.
[0069] Here, the Focus module divides the input image into equal slices according to the spatial neighbor positions in the spatial dimension. For example, Figure 5 As shown in FIG, the Focus module is used to equally slice the input image in the spatial dimension to obtain four equal spatial slices. At this time, the spatial resolution of each spatial slice is half of the input image.
[0070] 303. Perform feature extraction on the spatial slice to obtain a feature slice.
[0071] If the feature slices are directly spliced in the channel dimension, then after the input image is translated, since the order of the channels corresponding to each feature slice is somewhat random, and the order of the convolution kernels of each feature slice in the subsequent steps is fixed, direct splicing will cause uncertainty in the underlying features of the encoder, and thus cause the loss of translation equality. Therefore, the present application extracts features from each spatial slice based on a cascaded hole convolution layer to obtain feature slices, and then uses the feature slices as the input of the Effective Channel Attention (ECA) module in the channel dimension in the subsequent steps, which can avoid the problem of uncertainty in the underlying features of the encoder caused by direct splicing.
[0072] In some embodiments, a first convolution kernel and a second convolution kernel are used to sequentially extract features from spatial slices to obtain feature slices, which may include: performing convolution processing on the spatial slices according to the first convolution kernel to obtain convolution slices; performing compression processing on the convolution slices on their respective corresponding channels according to the second convolution kernel to obtain feature slices; wherein the first convolution kernel is an ordinary convolution kernel with a first preset convolution kernel size; here, the first convolution kernel is a convolution kernel whose size may be one of 3x3, 5x5, 7x7, 9x9...nxn, wherein n is an odd number, and preferably, the first convolution kernel is an ordinary convolution kernel of a convolution kernel size of 3x3; the second convolution kernel is an ordinary convolution kernel of a 1x1 convolution kernel, and the ordinary convolution kernel is relative to the convolution kernel used in the void convolution layer.
[0073] 304. Input the feature slices into the channel attention module to obtain the channel weights corresponding to each feature slice.
[0074] It should be noted that the channel attention module is not limited to the ECA channel attention module used in the present invention, but can also be replaced by any other channel attention module such as the SE (Squeeze and Excitation) attention module.
[0075] The following examples illustrate the channel weights and spatial component weights. Here, when an image is divided into four different spatial slices, see Figure 5, the spatial components refer to the four spatial components 1, 2, 3, and 4 corresponding to each spatial slice, and each spatial component has three channels. After the convolution of Conv(1×1,1), the three channels of each spatial component will be compressed into one channel. Therefore, the four spatial components are compressed into four channels in total and then spliced in the channel dimension to obtain the spliced features. The features are input into the ECA channel attention module to obtain four weights, where the four weights are respectively weighted for the four spatial components as a whole (each spatial component has three channels). The overall weighting here is simply to multiply one weight by the three channels of a spatial component. Since the weighting is the overall weighting of the original spatial component, that is, one weight corresponds to the entire spatial component, therefore, four weights correspond to four spatial components, and the four spatial components have a total of 12 channels. It can be seen that when the four spatial components are weighted as a whole in this application, although each spatial component has three RGB channels, the overall weighting of the four spatial components refers to weighting the four spatial components by the weights of the three same RGB channels to obtain the weights of four different spatial components.
[0076] It should be noted that the ECA channel attention module of this application is a plug-and-play module that can represent different feature transformations in different scenarios, such as Figure 6 As shown, assuming that any feature transformation F including convolution is given tr : X→U, where X∈R H'×W'×C' , U∈R H×W×C , where H′, W′, C′ represent the height, width and number of channels of the output feature respectively, and H, W, C represent the height, width and number of channels of the output feature after feature transformation respectively. First, through the squeezing operation, the global information is compressed into a channel descriptor using Global Average Pooling (GAP), and the statistic z∈R is generated by shrinking the spatial dimension H×W in the feature U. C , where the cth element of z can be expressed as:
[0077]
[0078] Among them, z c is a set of local features, the statistical information of these local features can express the entire image and have a global receptive field, u c Represents the c-th channel feature in the output feature space U. Statistics z c Without dimensionality reduction, the attention of each channel can be obtained by the following method, and the size of the weight is used as the standard for measuring attention: w = σ (W kz); where W is the weight vector obtained by the ECA channel attention module; z is the vector obtained after global average pooling compression of each channel. This formula avoids the complete independence between different channels, thereby achieving local cross-channel interaction while ensuring efficiency and effectiveness, where w∈R C Represents the weight vector of each channel obtained by the ECA channel attention module, W k Contains k×C parameters, which are defined as:
[0079]
[0080] σ(·) represents the nonlinear sigmoid activation function: σ(x) = 1 / (1+e -x );z i The weight is only considered by z i The calculation formula for the interaction between it and its k adjacent elements is: Among them, w i represents the weight of the i-th channel, Represents the jth element of the i-th channel convolution kernel, Represents the i-th channel and The corresponding j-th element, Indicates that y i A set of k adjacent channels.
[0081] Here, in order to reduce the complexity of the model, all channels can share the same parameters, namely: When σ(x)=1 / (1+e -x ), w i It is explicitly used to model the correlation between features. The more important the image features contained in the i-th channel are, the larger the corresponding w i The larger it is, the more attention the model pays to this channel. It can be further simplified into a one-dimensional convolution operation, where the formula for the one-dimensional convolution operation is: w = σ (M (k) *z); where M represents the one-dimensional convolution kernel and k is the size of the corresponding convolution kernel, representing the coverage of local cross-channel interactions. The size of the one-dimensional convolution kernel can be adaptively determined by a function of the channel dimension C. The calculation formula used is: Where |x| odd represents the odd number closest to x, and k is the number of adjacent elements.
[0082] 305. Each spatial slice is weighted respectively using the channel weight corresponding to each feature slice to complete weighted processing of the spatial slice.
[0083] The channel weights in this application are the channel weights corresponding to each feature slice obtained after the feature slice is input into the ECA channel attention module. The essence of the channel weights here is to weight different channels. The principle of channel weights is the same as that of spatial component weights, but they are referred to differently. Therefore, the channel in the ECA channel attention module can be regarded as a spatial component in this application, just as the role of the last 1×1 ordinary convolution kernel in the Focus_attention module is to compress multiple channels of a spatial component into one channel, and the four spatial components are compressed into four channels in total and input into the ECA channel attention module. Therefore, the use of the obtained channel weights to perform weighted processing on each spatial slice can be understood as weighting the entire spatial component, which is equivalent to treating the entire spatial component as a channel.
[0084] Here, the channel attention module is preferably an ECA channel attention module. When using the Foucs module for downsampling, by utilizing the ECA channel attention module, different channel weights and the weights of the spatial components corresponding to each feature slice can be obtained. The larger the weight, the more important the corresponding channel weight and the spatial component corresponding to each feature slice. Here, after obtaining the weights of different channels, each spatial slice is weighted as a whole, which can make the movement of the input image have good robustness, thereby ensuring that the segmentation result volatility is small when the input image moves a small amount, so that the translation equality of the segmentation network is well maintained.
[0085] 306. Arrange and splice the weighted spatial slices according to a preset arrangement rule to obtain spliced slices.
[0086] like Figure 5 As shown in the figure, the weighted spatial slices are rearranged and spliced according to the preset arrangement rules, so that the spatial components corresponding to the spatial slices are rearranged in the channel order according to the preset arrangement rules in the channel dimension. Here, the purpose of rearranging the channel order is to adapt to the fixed order of the convolution kernel to ensure that the terminal features of the encoder are only shifted in the spatial position, ensuring the translation equality of the network structure, and then forming the Focus_attention module as a whole.
[0087] In some embodiments, arranging and splicing the weighted spatial slices according to a preset arrangement rule to obtain spliced slices may include: obtaining a non-descending arrangement order of the weights of each channel, and using the non-descending arrangement order as the preset arrangement rule; rearranging the weighted spatial slices according to the non-descending arrangement order; and splicing the re-weighted spatial slices in the channel dimension to obtain spliced slices.
[0088] Here, the weighted spatial slices are rearranged in non-descending order, which can be understood as follows: if the spatial components corresponding to the four spatial slices are passed through the ECA channel attention module, the weights obtained are 0.1, 0.3, 0.2, and 0.4, then the order of superposition of the channel dimension of the four spatial slices is the first slice, the third slice, the second slice, and the fourth slice.
[0089] If the weighted spatial slices are directly spliced in the channel dimension, the order of the channels will be somewhat random after the input image is translated. However, the order of the convolution kernels used in the subsequent convolution is fixed. Therefore, direct splicing will cause uncertainty in the underlying features of the encoder, and thus cause the loss of translation equality. In addition, when using the Foucs module for downsampling, the ECA channel attention module is used to obtain the weights of different spatial components. The larger the weight, the more important the corresponding spatial component. Therefore, the non-descending order of the channel weights is used as the preset arrangement rule. Finally, the spatial components corresponding to each spatial slice are rearranged in the channel order according to the non-descending order of the channel weights. The purpose of rearranging the channel order is to adapt to the fixed order of the convolution kernels, thereby ensuring that the terminal features of the encoder are only shifted in spatial position.
[0090] 307. Feature extraction is performed on the spliced slices according to the cascaded dilated convolutional layers to obtain a downsampled feature map.
[0091] Here, without sacrificing the spatial resolution of the spatial slices in the encoder, cascaded dilated convolutional layers with different spatial resolutions are used to expand the receptive field. To avoid grid effects, the dilation ratios are all zigzag cyclic structures, with the preferred dilation ratio being [1, 2, 5, 7, 1, 2, 5, 7].
[0092] 308. Use the Unfocus module in the decoder to upsample the downsampled feature map to obtain a segmented image.
[0093] It should be noted that the Unfocus module here can perform an inverse operation on the downsampled feature map obtained after the Focus module processes the input image to obtain a segmented image.
[0094] In some embodiments, the downsampled feature map is upsampled using the Unfocus module in the decoder to obtain a segmented image, which may include: using the Unfocus module in the decoder to restore the spatial resolution of the downsampled feature map to the same as the spatial resolution of the image to be processed; and restoring the downsampled feature map after the spatial resolution is restored to the spatial position of its respective corresponding spatial slice to obtain a segmented image.
[0095] Here, during upsampling, the Unfocus module is used to restore the feature map of the decoder's underlying features by twice the upsampling, so that the spatial resolution of the obtained segmented image is the same as that of the original input image.
[0096] Furthermore, the downsampled feature maps after restoring the spatial resolution are restored to the spatial positions of their respective corresponding spatial slices to obtain a segmented image, which can include: extracting features from the upsampled feature maps according to the third convolution kernel; performing channel dimension fusion processing on the upsampled feature maps after feature extraction according to the fourth convolution kernel to obtain a predicted probability map, and using the predicted probability map as the segmentation result; wherein the third convolution kernel is an ordinary convolution kernel of the second preset convolution kernel size; here, the second convolution kernel is a convolution kernel whose size can be one of 3x3, 5x5, 7x7, 9x9...nxn, where n is an odd number; preferably, the third convolution kernel is an ordinary convolution kernel with a convolution kernel size of 3x3; and the fourth convolution kernel is a 1x1 ordinary convolution kernel.
[0097] Here, after upsampling the downsampled feature map, a common convolution kernel of size 3 is used in the decoder to further extract features, and finally a convolution kernel of size 1 is used to fuse the channel dimension to obtain the final predicted probability map.
[0098] The present invention provides a method for image segmentation with reduced volatility, wherein the input image is downsampled by a Focus module in an encoder to obtain spatial slices; the spatial slices are then subjected to feature extraction to obtain feature slices; the feature slices are input into an ECA channel attention module to obtain channel weights corresponding to the respective feature slices, and each spatial slice is subjected to weighted processing according to the obtained channel weights; the weighted spatial slices are arranged and spliced according to a preset arrangement rule to obtain spliced slices; the spliced slices are subjected to feature extraction according to a cascaded hole convolution layer to obtain a downsampled feature map; finally, the downsampled feature map is upsampled by an Unfocus module in a decoder to obtain a segmented image. The method provided by the present invention can improve the robustness of the input image in the segmentation network, ensure that the volatility of the result segmented by the segmentation network when the input image moves a small amount is small, and thus the translation equality of the segmentation network is well maintained, and the translation of the input image in any direction is achieved. As long as the same defect is in a non-edge position, the segmentation area of the defect and the IOU of the segmentation result can be kept basically unchanged, thereby achieving the requirement of meeting the rapid detection requirement without losing the segmentation accuracy.
[0099] Furthermore, as a response to the above Figure 2-Figure 3 The embodiment of the present invention provides an image segmentation device with reduced volatility, such as Figure 7As shown, the device includes:
[0100] An image acquisition module 71 is used to acquire an input image;
[0101] A downsampling processing module 72 is configured to downsample the input image using an encoder to obtain spatial slices;
[0102] A splicing module 73 is configured to arrange and splice the spatial slices according to a preset arrangement rule to obtain spliced slices;
[0103] A feature extraction module 74 is configured to perform feature extraction on the spliced slices according to the cascaded dilated convolutional layers to obtain a downsampled feature map;
[0104] The upsampling processing module 75 is used to use a decoder to perform upsampling processing on the downsampled feature map to obtain a segmented image.
[0105] Furthermore, the downsampling processing module 72 includes:
[0106] A feature slice acquisition unit is used to extract features from the spatial slice to obtain a feature slice;
[0107] The channel weight acquisition unit is used to input the feature slices into the channel attention module to obtain the channel weights corresponding to each feature slice;
[0108] The weighted processing unit is used to weight each spatial slice respectively using the channel weight corresponding to each feature slice, thereby completing the weighted processing of the spatial slice.
[0109] Furthermore, the splicing module 73 includes:
[0110] A preset arrangement rule obtaining unit, configured to obtain a non-descending arrangement order of each channel weight and use the non-descending arrangement order as a preset arrangement rule;
[0111] a rearrangement unit, configured to rearrange the weighted spatial slices according to the non-descending arrangement order;
[0112] The splicing unit is used to splice the rearranged spatial slices in the channel dimension to obtain spliced slices.
[0113] Furthermore, the splicing module 73 includes:
[0114] a convolution slice acquisition unit, configured to perform convolution processing on the spatial slice according to the first convolution kernel to obtain a convolution slice;
[0115] The feature slice acquisition unit is used to compress the convolution slices on their respective corresponding channels according to the second convolution kernel to obtain feature slices.
[0116] Among them, the first convolution kernel is a common convolution kernel with a first preset convolution kernel size; the second convolution kernel is a 1x1 common convolution kernel.
[0117] Furthermore, the downsampling processing module 72 includes:
[0118] A spatial slice acquisition unit is used to downsample the input image through the Focus module to obtain spatial slices;
[0119] The upsampling processing module 75 includes:
[0120] The segmentation image acquisition unit is used to use the Unfocus module to upsample the downsampled feature map to obtain a segmentation image.
[0121] Furthermore, the spatial slice acquisition unit includes:
[0122] The spatial slice acquisition subunit is used to slice the input image equally in the spatial dimension according to the preset spatial resolution using the Focus module in the encoder to obtain spatial slices with the preset spatial resolution.
[0123] Furthermore, the segmented image acquisition unit includes:
[0124] A restoration subunit, configured to restore the spatial resolution of the downsampled feature map to the same as the spatial resolution of the image to be processed using the Unfocus module;
[0125] The segmented image acquisition subunit is used to restore the downsampled feature maps after restoring the spatial resolution to the spatial positions of their corresponding spatial slices to obtain a segmented image.
[0126] Furthermore, the segmented image acquisition subunit includes:
[0127] a feature extraction subunit, configured to extract features from the upsampled feature map according to the third convolution kernel;
[0128] The segmentation image subunit is used to perform channel dimension fusion processing on the upsampled feature map after feature extraction according to the fourth convolution kernel to obtain a predicted probability map, and use the predicted probability map as the segmentation image.
[0129] Among them, the third convolution kernel is a common convolution kernel with a second preset convolution kernel size; the fourth convolution kernel is a 1x1 common convolution kernel.
[0130] Furthermore, the device further comprises:
[0131] The filtering processing module is used to perform low-pass filtering on the input image using a preset Gaussian kernel to obtain the input image after low-pass filtering.
[0132] The present invention provides a device for image segmentation that reduces volatility. This device uses an encoder to downsample an input image to obtain spatial slices; then arranges and splices the spatial slices according to a preset arrangement rule to obtain spliced slices; then extracts features from the spliced slices using a cascade of dilated convolutional layers to obtain a downsampled feature map; and finally, uses a decoder to upsample the downsampled feature map to obtain a segmented image. The method provided by the present invention can improve the robustness of the input image in the segmentation network, ensuring that the segmentation results obtained by the segmentation network have low volatility when the input image is slightly shifted. This in turn effectively maintains the segmentation network's translational equality, thereby enhancing the stability of image segmentation when the input image is slightly shifted.
[0133] It should be noted that the image segmentation device for reducing volatility provided in the above embodiment only uses the division of the above-mentioned functional modules as an example to illustrate image segmentation. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above. In addition, the image segmentation device for reducing volatility provided in the above embodiment and the image segmentation method for reducing volatility are based on the same concept. The specific implementation process is detailed in the method embodiment and will not be repeated here.
[0134] According to another aspect of the present disclosure, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps of the method described in the present disclosure are implemented.
[0135] According to another aspect of the present disclosure, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the computer program is executed by the processor, the steps of the method described in the present disclosure are implemented.
[0136] refer to Figure 8 , a block diagram of an electronic device 800 that can serve as a server or client of the present disclosure will now be described, which is an example of a hardware device that can be applied to various aspects of the present disclosure. The electronic device is intended to represent various forms of digital electronic computer devices, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present disclosure described and / or required herein.
[0137] like Figure 7 As shown, the electronic device 800 includes a computing unit 801, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 802 or a computer program loaded from a storage unit 808 into a random access memory (RAM) 803. In the RAM 803, various programs and data required for the operation of the electronic device 800 can also be stored. The computing unit 801, the ROM 802, and the RAM 803 are connected to each other via a bus 804. An input / output (I / O) interface 805 is also connected to the bus 804.
[0138] Multiple components within electronic device 800 are connected to I / O interface 805, including an input unit 806, an output unit 807, a storage unit 808, and a communication unit 809. Input unit 806 can be any type of device capable of inputting information into electronic device 800. Input unit 806 can receive input numeric or character information and generate key signal input related to user settings and / or function control of the electronic device. It may include, but is not limited to, a mouse, keyboard, touch screen, trackpad, trackball, joystick, microphone, and / or remote control. Output unit 807 can be any type of device capable of presenting information, and may include, but is not limited to, a display, a speaker, an audio / visual output terminal, a vibrator, and / or a printer. Storage unit 808 may include, but is not limited to, a magnetic disk or an optical disk. Communication unit 809 allows electronic device 800 to exchange information / data with other devices via computer networks such as the Internet and / or various telecommunication networks. It may include, but is not limited to, a modem, a network card, an infrared communication device, a wireless communication transceiver and / or chipset, such as a Bluetooth™ device, a WiFi device, a WiMax device, a cellular communication device, and / or the like.
[0139] The computing unit 801 can be a variety of general-purpose and / or specialized processing components with processing and computing capabilities. Some examples of the computing unit 801 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units that run machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The computing unit 801 performs the various methods and processes described above, such as method 200. For example, in some embodiments, method 200 can be implemented as a computer software program that is tangibly contained in a machine-readable medium, such as a storage unit 808. In some embodiments, part or all of the computer program can be loaded and / or installed on the electronic device 800 via ROM 802 and / or communication unit 809. When the computer program is loaded into RAM 803 and executed by the computing unit 801, one or more steps of the method 200 described above can be performed. Alternatively, in other embodiments, the computing unit 801 can be configured to perform method 200 in any other appropriate manner (e.g., by means of firmware).
[0140] Various embodiments of the systems and techniques described above can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), system-on-chip systems (SOCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments can include being implemented in one or more computer programs that are executable and / or interpreted on a programmable system that includes at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0141] The program code for implementing the method of the present disclosure can be written in any combination of one or more programming languages. These program codes can be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device so that when the program code is executed by the processor or controller, the functions / operations specified in the flow chart and / or block diagram are implemented. The program code can be executed entirely on the machine, partially on the machine, as a stand-alone software package, partially on the machine and partially on a remote machine, or entirely on a remote machine or server.
[0142] In the context of the present disclosure, a machine-readable medium can be a tangible medium that can contain or store a program for use by or in conjunction with an instruction execution system, device or equipment. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium can include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0143] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).
[0144] The systems and techniques described herein can be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network (LAN), a wide area network (WAN), and the Internet.
[0145] A computer system may include a client and a server. The client and server are generally remote from each other and typically interact through a communication network. The client-server relationship arises through computer programs running on the respective computers and having a client-server relationship with each other. The server may be a cloud server, a server in a distributed system, or a server integrated with a blockchain.
[0146] It should be understood that the various forms of the processes shown above can be used to reorder, add, or delete steps. For example, the steps described in this disclosure can be performed in parallel, sequentially, or in a different order, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved. This is not limited herein.
[0147] Although the embodiments or examples of the present disclosure have been described with reference to the accompanying drawings, it should be understood that the above-mentioned methods, systems and devices are merely exemplary embodiments or examples, and the scope of the present invention is not limited by these embodiments or examples, but is only limited by the claims after authorization and their equivalents. Various elements in the embodiments or examples may be omitted or replaced by their equivalents. In addition, the steps may be performed in an order different from that described in this disclosure. Further, the various elements in the embodiments or examples may be combined in various ways. It is important that as technology evolves, many of the elements described herein may be replaced by equivalent elements that appear after this disclosure.
Claims
1. A method for image segmentation with reduced volatility, characterized in that: include: Get the input image; Downsampling the input image using an encoder to obtain spatial slices; Arranging and splicing the spatial slices according to a preset arrangement rule to obtain spliced slices; Performing feature extraction on the spliced slices according to the cascaded dilated convolutional layers to obtain a downsampled feature map; Using a decoder to upsample the downsampled feature map to obtain a segmented image; The step of downsampling the input image using an encoder to obtain spatial slices includes: Downsampling the input image through the Focus module to obtain the spatial slice; The downsampling of the input image by the Focus module to obtain the spatial slice includes: According to a preset spatial resolution, the input image is sliced equally in the spatial dimension using a Focus module in the encoder to obtain spatial slices with the preset spatial resolution; After downsampling the input image using an encoder to obtain spatial slices, the spatial slices are arranged and spliced according to a preset arrangement rule, and before the spliced slices are obtained, the method includes: Performing feature extraction on the spatial slice to obtain a feature slice; Inputting the feature slices into a channel attention module to obtain channel weights corresponding to each feature slice; Each of the spatial slices is weighted respectively using the channel weights corresponding to each of the feature slices to complete weighted processing of the spatial slices.
2. The method according to claim 1, characterized in that Arranging and splicing the spatial slices according to a preset arrangement rule to obtain spliced slices includes: Obtaining a non-descending order of the channel weights, and using the non-descending order as a preset arrangement rule; Rearranging the weighted spatial slices according to the non-descending order; The rearranged spatial slices are spliced in the channel dimension to obtain the spliced slices.
3. The method according to claim 1, characterized in that The extracting features from the spatial slice to obtain a feature slice includes: Performing convolution processing on the spatial slice according to a first convolution kernel to obtain a convolution slice; The convolution slices are compressed on their respective corresponding channels according to the second convolution kernel to obtain the feature slices.
4. The method according to claim 3, characterized in that The first convolution kernel is a common convolution kernel with a first preset convolution kernel size; the second convolution kernel is a 1x1 common convolution kernel.
5. The method according to claim 1, wherein The upsampling process is performed on the downsampled feature map by using a decoder to obtain a segmented image, comprising: The downsampled feature map is upsampled using an Unfocus module to obtain the segmented image.
6. The method according to claim 5, characterized in that The upsampling process is performed on the downsampled feature map by using the Unfocus module to obtain the segmented image, including: Using the Unfocus module to restore the spatial resolution of the downsampled feature map to the same as the spatial resolution of the image to be processed; The downsampled feature maps after restoring the spatial resolution are restored to the spatial positions of the spatial slices corresponding to them to obtain the segmented images.
7. The method according to claim 6, characterized in that Restoring the downsampled feature maps after restoring the spatial resolution to the spatial positions of the spatial slices corresponding thereto to obtain the segmented images includes: Performing feature extraction on the upsampled feature map according to a third convolution kernel; The upsampled feature map after feature extraction is fused in the channel dimension according to the fourth convolution kernel to obtain a predicted probability map, and the predicted probability map is used as the segmented image.
8. The method according to claim 7, characterized in that The third convolution kernel is a common convolution kernel having a second preset convolution kernel size; the fourth convolution kernel is a 1x1 common convolution kernel.
9. The method according to claim 1, characterized in that Before downsampling the input image by using an encoder to obtain spatial slices, the method includes: The input image is subjected to low-pass filtering using a preset Gaussian kernel to obtain the input image after low-pass filtering.
10. An image segmentation device for reducing volatility, characterized in that: include: An image acquisition module, used to acquire an input image; A downsampling processing module, configured to downsample the input image using an encoder to obtain spatial slices; A splicing module, configured to arrange and splice the spatial slices according to a preset arrangement rule to obtain spliced slices; A feature extraction module, configured to extract features from the spliced slices according to the cascaded dilated convolutional layers to obtain a downsampled feature map; An upsampling processing module, configured to perform upsampling processing on the downsampled feature map using a decoder to obtain a segmented image; Wherein, the downsampling processing module includes: A spatial slice acquisition unit is used to downsample the input image through the Focus module to obtain spatial slices; The spatial slice acquisition unit includes: The spatial slice acquisition subunit is used to slice the input image equally in the spatial dimension according to the preset spatial resolution using the Focus module in the encoder to obtain spatial slices with the preset spatial resolution; After downsampling the input image using an encoder to obtain spatial slices, the image segmentation device arranges and splices the spatial slices according to a preset arrangement rule to obtain spliced slices, and before the image segmentation device arranges and splices the spatial slices according to a preset arrangement rule to obtain spliced slices, further configured to: Performing feature extraction on the spatial slice to obtain a feature slice; Inputting the feature slices into a channel attention module to obtain channel weights corresponding to each feature slice; Each of the spatial slices is weighted respectively using the channel weights corresponding to each of the feature slices to complete weighted processing of the spatial slices.
11. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 9 are implemented.
12. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 9 are implemented.
Citation Information
Patent Citations
3D medical image segmentation method and device based on hierarchical perception fusion and storage medium
CN112465754A
Coding and decoding network port image segmentation method fusing semantic flow field
CN113052180A