Cordyceps fine impurity pixel-level enhancement and accurate segmentation method and system based on super-resolution reconstruction
Patent Information
- Application Number
- CN202611274293.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-21
- Publication Date
- 2026-10-30
AI Technical Summary
[0006]本发明的目的在于提供基于超分辨率重建的燕窝细微杂质像素级增强与精准分割方法及系统,用以解决现有技术中燕窝反射图像中纤维纹理与细微杂质视觉相近、透射图像轮廓定位不足、常规超分辨率重建和分割串行处理难以兼顾细节重建与像素级杂质分割的技术问题
本发明公开了基于超分辨率重建的燕窝细微杂质像素级增强与精准分割方法及系统,采集反射光数字图像和透射光数字图像,并按定位标记执行像素配准,反射图像中的表面纹理、杂质边缘与透射图像中的暗斑投影能够进入同一空间坐标关系。该处理使后续特征编码、动态调制和反馈处理能够在像素位置一致的图像对上执行,减少多模态图像位置偏差对杂质分割边界的影响。
Smart Images

Figure CN123015274A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of machine vision and image processing technology, specifically to a method and system for pixel-level enhancement and precise segmentation of minute impurities in bird's nest based on super-resolution reconstruction. Background Technology
[0002] Bird's nest raw materials often contain fine impurities such as feathers, eggshell fragments, and black spots. In current processing methods, these fine impurities are usually picked out manually under strong light. Because bird's nest itself is a semi-transparent gel with a natural fibrous texture, the morphology of some fine feather impurities in visible light reflection images is similar to the fibrous texture of bird's nest. Both manual picking and ordinary image segmentation are easily affected by background texture.
[0003] With the development of machine vision inspection, existing solutions attempt to acquire images of bird's nests using industrial cameras and identify impurities. However, numerous tiny black dots, downy feathers, and debris occupy only a few pixels at conventional resolutions, resulting in blurred boundaries. Direct segmentation is prone to breakage, missed segmentation, or inaccurate boundaries. When using a single reflective image, the image can retain surface texture and details, but the bird's nest fiber texture is simultaneously enhanced along with the edges of impurities. When using a transmission image, impurities inside the bird's nest can form dark spot projections, but the surface texture and contour details in the transmission image are insufficient, making it difficult to directly provide accurate impurity boundaries.
[0004] In existing technologies, the sequential approach of performing segmentation after super-resolution reconstruction typically only improves the overall image resolution and cannot distinguish between impurity areas that require focused enhancement and areas prone to misjudgment, such as bird's nest textures. Directly stitching multi-source images into the segmentation network also makes it difficult to achieve targeted modulation of dark spot locations in transmission imaging for the super-resolution reconstruction process of reflective images.
[0005] Therefore, this application provides a method for pixel-level enhancement and precise segmentation of fine impurities in bird's nest based on super-resolution reconstruction to solve the above-mentioned technical problems. Summary of the Invention
[0006] The purpose of this invention is to provide a method and system for pixel-level enhancement and precise segmentation of fine impurities in bird's nest based on super-resolution reconstruction, in order to solve the technical problems in the prior art where fiber texture and fine impurities in bird's nest reflection images are visually similar, the contour positioning of transmission images is insufficient, and conventional super-resolution reconstruction and segmentation serial processing cannot simultaneously take into account detail reconstruction and pixel-level impurity segmentation.
[0007] To address the aforementioned technical problems, this invention provides a method for pixel-level enhancement and precise segmentation of minute impurities in bird's nest based on super-resolution reconstruction, including: Digital images of reflected light and transmitted light of the bird's nest to be tested were acquired, and pixel registration was performed according to the positioning marks to obtain registered image pairs; The reflected light digital image and the transmitted light digital image are respectively encoded into an initial reflection feature map and an initial transmission feature map; In a preset number of dynamic modulation residual blocks, the input reflection feature map is convolved, and the initial transmission feature map is pooled and fully connected to form channel-wise scaling coefficients and channel-wise bias coefficients. Based on the channel-by-channel scaling factor and the channel-by-channel bias factor, affine modulation is performed on the convolutional reflection feature map to obtain the cascaded modulated reflection feature map; Subpixel upsampling is performed on the cascaded modulated reflection feature map to obtain a high-resolution feature map, and initial pixel classification is performed on the high-resolution feature map to obtain an initial impurity probability map; The initial impurity probability map is scaled and smoothed to form an impurity prior attention map, which is then applied to the high-resolution feature map pixel by pixel to obtain a feedback processing feature map. Image reconstruction and pixel-by-pixel classification are performed on the feedback processing feature map to output a high-resolution bird's nest reconstruction image and an impurity segmentation mask.
[0008] In some specific embodiments, digital images of reflected light and transmitted light of the bird's nest to be tested are acquired, and pixel registration is performed according to the positioning marks to obtain a registered image pair, further including: Digital images of reflected light containing surface texture and impurity details of bird's nest were acquired under reflected illumination, and digital images of transmitted light containing dark spot projections inside bird's nest were acquired under transmitted illumination. Read the pixel coordinates of the transparent stage positioning mark in the reflected light digital image and the transmitted light digital image, and calculate the image registration transformation relationship; Resample the transmitted light digital image or the reflected light digital image according to the image registration transformation relationship to obtain a spatially consistent registered image pair.
[0009] In some specific embodiments, encoding the reflected light digital image and the transmitted light digital image into an initial reflection feature map and an initial transmission feature map, respectively, further includes: Convolution and nonlinear activation are performed on the reflected light digital image to obtain an initial reflection feature map containing the surface texture of the bird's nest and the reflection edges of impurities; Convolution and nonlinear activation are performed on the transmitted light digital image to obtain an initial transmission feature map containing the projection positions of impurity dark spots; The initial reflection feature map is fed into the reflection branch of the dynamic modulation residual block, and the initial transmission feature map is maintained as the modulation signal of each dynamic modulation residual block.
[0010] In some specific embodiments, affine modulation is performed on the convolutionally processed reflection feature map based on the channel-by-channel scaling factor and the channel-by-channel bias factor to obtain a cascaded modulated reflection feature map, further including: Perform convolution on the current input reflection feature map to obtain an intermediate reflection feature map; Global pooling is performed on the initial transmission feature map to obtain the transmission channel statistical vector; The transmission channel statistical vector is mapped to a channel-by-channel scaling factor and a channel-by-channel bias factor; Based on the channel-by-channel scaling factor and the channel-by-channel bias factor, a channel-by-channel affine transformation is performed on the intermediate reflection feature map to obtain the current modulation feature map; Perform a residual connection between the current modulation feature map and the current input reflection feature map, and send the residual connection result to the next dynamic modulation residual block until the cascaded modulation reflection feature map is obtained.
[0011] In some specific embodiments, subpixel upsampling is performed on the cascaded modulated reflection feature map to obtain a high-resolution feature map, and initial pixel classification is performed on the high-resolution feature map to obtain an initial impurity probability map, including: The cascaded modulated reflection feature map is converted into a feature map to be rearranged through channel-adaptive convolution. The feature map to be rearranged is subjected to subpixel rearrangement according to a preset magnification ratio to obtain a high-resolution feature map; The high-resolution feature map is input into the initial segmentation convolutional layer to obtain the probability that each pixel belongs to the impurity region, and the probabilities of all pixels are combined to form the initial impurity probability map.
[0012] In some specific embodiments, the initial impurity probability map is scaled and smoothed to form an impurity prior attention map, which is then applied pixel-by-pixel to the high-resolution feature map to obtain a feedback processing feature map, further including: The initial impurity probability map is downsampled to obtain a low-scale probability map; Gaussian smoothing is applied to the low-scale probability map to obtain a smoothed probability map; The smoothed probability map is upsampled to the spatial size of the high-resolution feature map to obtain the impurity prior attention map; The impurity prior attention map is adjusted based on a preset learnable scaling parameter, and the high-resolution feature map is multiplied by a pixel-wise weighted term containing the adjusted impurity prior attention map to obtain a feedback processing feature map.
[0013] In some specific embodiments, image reconstruction and pixel-by-pixel classification are performed on the feedback processing feature map to output a high-resolution bird's nest reconstruction image and an impurity segmentation mask, further including: The feedback processing feature map is input into the reconstruction residual block and the reconstruction convolutional layer to obtain a high-resolution bird's nest reconstruction image; The feedback processing feature map is input into a pixel classification structure containing downsampling encoding path, upsampling decoding path and cross-layer concatenation path to obtain an impurity probability map; The impurity probability map is processed by a preset threshold and connected component analysis to output an impurity segmentation mask containing the location, outline and size of impurity instances.
[0014] In some specific embodiments, image reconstruction and pixel-by-pixel classification are performed on the feedback processing feature map using parameters trained with a closed-loop interaction loss, the formation of which includes: Obtain the training reconstructed image and the training impurity segmentation mask; The pixel difference between the trained reconstructed image and the high-resolution ground truth image is calculated, and the pixel difference of the impurity region is weighted according to the trained impurity segmentation mask to obtain the super-resolution reconstruction loss. The cross-entropy between the training impurity segmentation mask and the manually labeled mask is calculated to obtain the segmentation loss; The training reconstructed image is re-encoded to obtain a reconstructed reflection feature map. The difference between the reconstructed reflection feature map and the high-resolution feature map is calculated to obtain the cyclic feature alignment loss. The closed-loop interaction loss is obtained by weighted summation of the super-resolution reconstruction loss, the segmentation loss, and the cyclic feature alignment loss.
[0015] In some specific embodiments, obtaining the training reconstructed image and the training impurity segmentation mask further includes: The reflected and transmitted images were acquired and registered according to the positioning marks to obtain high-resolution training image pairs; The high-resolution training image pair is downsampled into a low-resolution training image pair, and the reflection image in the high-resolution training image pair is used as the high-resolution ground truth image of reflection. Read the impurity pixel regions in the manually labeled mask, and combine the low-resolution training image pair, the high-resolution ground truth image, and the manually labeled mask to form a training sample.
[0016] Based on the same concept, this invention also provides a pixel-level enhancement and precise segmentation system for fine impurities in bird's nest based on super-resolution reconstruction, including: The image registration module is configured to acquire digital images of reflected light and transmitted light of the bird's nest to be tested, and perform pixel registration according to the positioning marks to obtain a registered image pair; The shallow coding module is configured to encode the reflected light digital image and the transmitted light digital image into a reflection initial feature map and a transmission initial feature map, respectively. The modulation coefficient generation module is configured to perform convolution processing on the input reflection feature map in a preset number of dynamic modulation residual blocks, and to generate channel-wise scaling coefficients and channel-wise bias coefficients by pooling and fully connected mapping of the initial transmission feature map. The affine modulation module is configured to perform affine modulation on the convolutional reflection feature map based on the channel-by-channel scaling coefficient and the channel-by-channel bias coefficient to obtain the cascaded modulated reflection feature map. The upsampling and initial classification module is configured to perform sub-pixel upsampling on the cascaded modulated reflection feature map to obtain a high-resolution feature map, and perform initial pixel classification on the high-resolution feature map to obtain an initial impurity probability map; The feedback processing module is configured to scale and smooth the initial impurity probability map to form an impurity prior attention map, and then apply it to the high-resolution feature map pixel by pixel to obtain the feedback processed feature map. The output module is configured to perform image reconstruction and pixel-by-pixel classification on the feedback processing feature map, and output a high-resolution bird's nest reconstruction image and an impurity segmentation mask.
[0017] Compared with existing technologies, its advantages are as follows: This invention discloses a method and system for pixel-level enhancement and precise segmentation of fine impurities in bird's nest based on super-resolution reconstruction. It acquires digital images of reflected and transmitted light, and performs pixel registration according to positioning markers. The surface texture and impurity edges in the reflected image are aligned with the dark spot projections in the transmitted image, allowing them to be placed in the same spatial coordinate relationship. This processing enables subsequent feature encoding, dynamic modulation, and feedback processing to be performed on image pairs with consistent pixel positions, reducing the impact of multimodal image positional deviations on impurity segmentation boundaries.
[0018] The reflected and transmitted digital images are encoded into initial reflection and initial transmission feature maps, respectively. The initial transmission feature map is then preserved as the modulation signal for each dynamic modulation residual block. Surface details of the reflected image and dark spot projection information of the transmitted image can enter subsequent processing as different feature streams. This process avoids simply mixing the two modes into a single path, allowing the dark spot information of the transmission image to continuously influence the multi-level reflection feature modulation process.
[0019] In the dynamic modulation residual block, the initial transmission feature map is pooled and fully connected to form channel-wise scaling and bias coefficients. Affine modulation is then performed on the convolutionally processed reflection feature map based on these channel-wise scaling and bias coefficients. The impurity spatial projection and channel response represented by the transmission image can participate in the upsampling preprocessing of the reflection features. This processing enables the super-resolution reconstruction chain to adjust the reflection feature response around the impurity candidate region, reducing the interference caused by simply enhancing the bird's nest fiber texture on subsequent segmentation.
[0020] Subpixel upsampling is performed on the cascaded modulated reflection feature map to obtain a high-resolution feature map. The reflection features after transmission modulation can be unfolded at a higher spatial resolution. This process helps to preserve the local edge information of small-sized impurities such as fine feathers, eggshell fragments, and black spots, providing a finer-grained feature basis for subsequent initial pixel classification and final pixel-by-pixel classification.
[0021] An initial impurity probability map is formed from a high-resolution feature map. This initial impurity probability map is then scaled and smoothed to form an impurity prior attention map, which is applied pixel-by-pixel to the high-resolution feature map to obtain a feedback processing feature map. The spatial probability of the segmentation result can be fed back to the reconstructed features. This process enables regions initially identified as impurities to obtain more explicit feature inputs in subsequent image reconstruction and pixel-by-pixel classification, while relatively constraining the response of background texture regions.
[0022] The feedback processing feature map is input into both the image reconstruction and pixel classification paths, outputting a high-resolution bird's nest reconstruction image and an impurity segmentation mask. The same feedback processing feature map serves both the reconstruction and segmentation outputs. This process enables the reconstruction and segmentation tasks to be collaboratively processed around the same impurity prior attention map, enhancing the data closure between the reconstruction features, the impurity probability map, and the final segmentation mask.
[0023] The relevant parameters are trained using a closed-loop interactive loss that includes super-resolution reconstruction loss, segmentation loss, and cyclic feature alignment loss. During training, a constraint relationship is formed between the high-resolution reconstructed image, the training impurity segmentation mask, and the high-resolution feature map. This process allows pixel differences in the reconstructed image, segmentation errors in impurity regions, and differences in features re-encoded after reconstruction to participate in parameter updates, which helps reduce feature shifts caused by the independent processes of reconstruction and segmentation. Attached Figure Description
[0024] Other features, objects, and advantages of this application will become more apparent from the following detailed description of non-limiting embodiments with reference to the accompanying drawings: Figure 1 This is a flowchart illustrating some specific embodiments of the method for pixel-level enhancement and precise segmentation of fine impurities in bird's nest based on super-resolution reconstruction of the present invention; Figure 2 These are schematic diagrams of the structure of the super-resolution reconstruction-based pixel-level enhancement and precise segmentation system for fine impurities in bird's nest in some specific embodiments of the present invention. Detailed Implementation
[0025] To make the objectives, technical solutions, and advantages of this application clearer, the application will be further described in detail below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0026] The terminology used in the embodiments of this application is for the purpose of describing particular embodiments only and is not intended to limit the application. The singular forms "a," "the," and "the" as used in the embodiments of this application are also intended to include the plural forms, unless the context clearly indicates otherwise, and "multiple" generally includes at least two.
[0027] It should be understood that the term "and / or" used in this article is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, and B existing alone. Additionally, the character " / " in this article generally indicates that the preceding and following related objects have an "or" relationship.
[0028] It should be understood that although the terms first, second, third, etc., may be used in the embodiments of this application, these descriptions should not be limited to these terms. These terms are only used to distinguish the descriptions. For example, first may also be referred to as second without departing from the scope of the embodiments of this application, and similarly, second may also be referred to as first.
[0029] Depending on the context, the words “if” or “suppose” as used here can be interpreted as “when” or “in response to determination” or “in response to detection.” Similarly, depending on the context, the phrases “if determination” or “if detection (of the stated condition or event)” can be interpreted as “when determination” or “in response to determination” or “when detection (of the stated condition or event)” or “in response to detection (of the stated condition or event).”
[0030] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that an article or device that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such an article or device. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the article or device that includes said element.
[0031] It should be noted that any symbols and / or numbers present in the specification that are not marked in the accompanying drawings are not reference numerals.
[0032] Reference Figure 1 A pixel-level enhancement and precise segmentation method for fine impurities in bird's nest based on super-resolution reconstruction includes: S101: Acquire digital images of reflected light and transmitted light of the bird's nest to be tested, and perform pixel registration according to the positioning marks to obtain a registered image pair; S102, the reflected light digital image and the transmitted light digital image are respectively encoded into a reflection initial feature map and a transmission initial feature map; S103, In a preset number of dynamic modulation residual blocks, the input reflection feature map is subjected to convolution processing, and the initial transmission feature map is mapped by pooling and fully connected to form a channel-wise scaling coefficient and a channel-wise bias coefficient. S104, perform affine modulation on the convolutional reflection feature map based on the channel-by-channel scaling coefficient and the channel-by-channel bias coefficient to obtain the cascaded modulated reflection feature map; S105, perform sub-pixel upsampling on the cascaded modulated reflection feature map to obtain a high-resolution feature map, and perform initial pixel classification on the high-resolution feature map to obtain an initial impurity probability map; S106, the initial impurity probability map is scaled and smoothed to form an impurity prior attention map, and then applied to the high-resolution feature map by pixel to obtain a feedback processing feature map; S107, perform image reconstruction and pixel-by-pixel classification on the feedback processing feature map, and output a high-resolution bird's nest reconstruction image and an impurity segmentation mask.
[0033] To provide a clearer explanation, the steps in the embodiments of the present invention are described in detail below: S101: Acquire digital images of reflected light and transmitted light of the bird's nest to be tested, and perform pixel registration according to the positioning marks to obtain a registered image pair; S101 further includes: Digital images of reflected light containing surface texture and impurity details of bird's nest were acquired under reflected illumination, and digital images of transmitted light containing dark spot projections inside bird's nest were acquired under transmitted illumination. Read the pixel coordinates of the transparent stage positioning mark in the reflected light digital image and the transmitted light digital image, and calculate the image registration transformation relationship; Resample the transmitted light digital image or the reflected light digital image according to the image registration transformation relationship to obtain a spatially consistent registered image pair.
[0034] Specifically, in this embodiment of the invention, a transparent optical glass stage is fixed to a precision displacement platform, and the bird's nest material to be tested is laid flat on the imaging area of the transparent optical glass stage. An industrial camera is positioned above the bird's nest, and a coaxial reflective light source and a bottom array transmissive light source are illuminated in a time-division manner. During reflected illumination acquisition, the industrial camera receives reflected light from the surface of the bird's nest, obtaining a digital image of reflected light containing the texture of the bird's nest fibers, details of the feather surface, edges of eggshell fragments, and edges of black spots; during transmissive illumination acquisition, the bottom array transmissive light source passes through the translucent bird's nest, and the industrial camera receives the transmissive imaging result, obtaining a digital image of transmissive light containing projections of dark spots from internal impurities. The reflected light digital image is denoted as... The transmitted light digital image is denoted as These two constitute the original multimodal inputs for subsequent processing.
[0035] At least four positioning marks are set on the transparent stage. These marks can be dots, crosses, or high-contrast squares located at the four corners of the imaging area. and The pixel coordinates of the detection and positioning markers are used to calculate the image registration transformation relationship according to the pixel correspondence between the same positioning markers. For example, when there is no significant perspective distortion in the stage plane, the image registration transformation relationship can use an affine transformation matrix; when there is a slight perspective change between the stage and the camera, the image registration transformation relationship can use a homography matrix. After the transformation relationship is calculated, the image registration transformation is performed on... Perform resampling, so that The position of the dark spot projection in the middle and The surface texture positions are located in the same pixel coordinate system; in another embodiment, the surface texture positions can also be... Perform resampling, so that and The images are placed into a unified processing coordinate system. Registered image pairs can be cropped to a preset size, such as 1024×1024 pixels, and then downsampled to the network input size, such as 512×512 pixels. The cropping window, downsampling factor, and pixel coordinates are all saved as image processing parameters, facilitating the subsequent mapping of the impurity segmentation mask back to the original image coordinates.
[0036] In this embodiment, a registration quality check can also be set. Specifically, the reprojection error of the registered positioning mark is compared with a preset pixel error threshold; when the reprojection error meets the preset pixel error threshold, the registered image pair is output; when the reprojection error does not meet the preset pixel error threshold, the positioning mark is re-detected or re-acquired. and For example, the preset pixel error threshold can be 2px. The boundary processing can prevent reflective textures and transmitted dark spots from misaligning into the subsequent dynamic modulation residual block, thereby reducing attention shift in the impurity region caused by registration deviation.
[0037] S102, the reflected light digital image and the transmitted light digital image are respectively encoded into a reflection initial feature map and a transmission initial feature map; S102 further includes: Convolution and nonlinear activation are performed on the reflected light digital image to obtain an initial reflection feature map containing the surface texture of the bird's nest and the reflection edges of impurities; Convolution and nonlinear activation are performed on the transmitted light digital image to obtain an initial transmission feature map containing the projection positions of impurity dark spots; The initial reflection feature map is fed into the reflection branch of the dynamic modulation residual block, and the initial transmission feature map is maintained as the modulation signal of each dynamic modulation residual block.
[0038] Specifically, in this embodiment of the invention, the reflective flow shallow encoder and the transmissive flow shallow encoder employ convolutional blocks with non-weight-sharing. The reflective flow shallow encoder receives... Output initial feature map of reflection ; Transmission flow shallow encoder receiver Output transmission initial feature map For example, both shallow encoders can employ convolutional layers with a kernel size of 3×3, a stride of 1, and padding of 1, and a rectified linear activation function, resulting in an output channel count of 64. Initial feature map of reflection. It mainly carries the surface fiber texture of bird's nest, feather edges, reflection boundaries of eggshell fragments, and surface details of black spots; initial transmission feature map It primarily carries the spatial location, area, and channel response of the transmitted dark spot. Since the sources of reflection and transmission imaging are different, the two shallow encoders employ independent convolution kernels, allowing each mode to retain its corresponding imaging characteristics.
[0039] In this embodiment, the formation of the initial reflection feature map and the initial transmission feature map can be represented as follows: ; ; in, Represents the initial feature map of reflection; This represents the initial characteristic map of transmission. Represents a digital image of reflected light; Represents a digital image of transmitted light; Indicates the weights of the reflection stream convolution kernel; Indicates the weights of the transmission flow convolution kernel; Indicates the reflected flow bias term; Indicates the transmission flow bias term; Indicates the convolution operation; This represents a non-linear activation function.
[0040] The features to be modulated in the subsequent reflection branch are used as modulated features in the dynamic modulation residual block. This serves as the modulation signal input for each dynamic modulation residual block. If an input image contains locally overexposed, underexposed, or blank areas, pixel values can first be normalized and an effective region mask can be applied to prevent invalid regions from participating in the convolution response statistics; the effective region mask can be adjusted accordingly. and This is passed to subsequent steps to limit the attention map from responding to invalid regions.
[0041] S103, In a preset number of dynamic modulation residual blocks, the input reflection feature map is subjected to convolution processing, and the initial transmission feature map is mapped by pooling and fully connected to form a channel-wise scaling coefficient and a channel-wise bias coefficient. Specifically, in this embodiment of the invention, the cross-modal dynamic modulation super-resolution module includes a preset number of dynamic modulation residual blocks and upsampling heads. The preset number can be 8, or it can be set to 4, 6, or 12 depending on the image size, computing power, and detection accuracy requirements. Each dynamic modulation residual block receives an input reflection feature map. and receive the same initial transmission feature map. As a modulated signal. Input reflection feature map. Within the current dynamically modulated residual block, two convolutional layers are first applied to form an intermediate reflection feature map. For example, The calculation can be expressed as: ; in, This represents the current input reflection feature map; and These represent the weights of the first and second convolutional layers within the current dynamic modulation residual block, respectively. and Indicates the corresponding bias term; This represents the intermediate reflection feature map after convolution processing.
[0042] The local texture response and impurity edge response in the reflected image are preserved and used as the direct processing object for subsequent affine modulation.
[0043] at the same time, Global average pooling is used to generate transmission channel statistical vectors. These vectors reflect the overall response intensity of the transmitted dark spot in each channel. The transmission channel statistical vectors are then input into two parallel fully connected mapping layers to obtain channel-wise scaling factors. and per-channel bias coefficient For example, and The formation of can be represented as: ; in, Indicates global average pooling; This represents the fully connected mapping used to generate the channel-by-channel scaling factor; This represents the fully connected mapping used to generate the channel-wise bias coefficients; and All with The number of channels is the same.
[0044] Through the above processing, the response of the projected position of the transmitted dark spot in each channel is compressed into channel-level parameters that can participate in the modulation of reflection characteristics. If If the effective dark spot area is too small, global average pooling can be combined with an effective area mask to only count the channel response within the effective imaging area of the transmission image, thus avoiding the influence of stage edges or background blank areas. and .
[0045] S104, perform affine modulation on the convolutional reflection feature map based on the channel-by-channel scaling coefficient and the channel-by-channel bias coefficient to obtain the cascaded modulated reflection feature map; S104 further includes: Perform convolution on the current input reflection feature map to obtain an intermediate reflection feature map; Global pooling is performed on the initial transmission feature map to obtain the transmission channel statistical vector; The transmission channel statistical vector is mapped to a channel-by-channel scaling factor and a channel-by-channel bias factor; Based on the channel-by-channel scaling factor and the channel-by-channel bias factor, a channel-by-channel affine transformation is performed on the intermediate reflection feature map to obtain the current modulation feature map; Perform a residual connection between the current modulation feature map and the current input reflection feature map, and send the residual connection result to the next dynamic modulation residual block until the cascaded modulation reflection feature map is obtained.
[0046] Furthermore, mapping the transmission channel statistical vector to a channel-by-channel scaling factor and a channel-by-channel bias factor includes: Extract the spatial proportion of the dark spot connected region and the mean channel response from the initial transmission feature map; The mean channel response is normalized and weighted according to the spatial proportion to obtain the transmission impurity weight vector; The transmission impurity weight vector is input into the parallel mapping layer to form the channel-by-channel scaling factor and the channel-by-channel bias factor, respectively.
[0047] Specifically, in this embodiment of the invention, the current modulation feature map It can be represented as: ; in, Indicates the intermediate features after modulation; This represents channel-by-channel multiplication; Indicates the scaling factor per channel; This represents the channel-by-channel bias coefficient.
[0048] because and Source The affine modulation incorporates the impurity location information and channel response state carried by the transmitted dark spot projection into the reflection feature reconstruction link, thus enabling the impurity candidate response in the reflection features to be directionally adjusted before upsampling. The current dynamic modulation residual block outputs a reflection feature map. It can be represented as: ; in, The reflection feature map serves as the input for the next dynamic modulation residual block. After multiple dynamic modulation residual blocks are cascaded, the last dynamic modulation residual block outputs the cascaded modulated reflection feature map. . It preserves the surface texture details in the reflected light digital image and includes dark spot position modulation information imported from the initial transmission feature map. If an abnormally high response is observed in the output of a certain dynamic modulation residual block, it can be adjusted accordingly. Set the cutoff range, for example, to Limited to between -1 and 1, or for Channel normalization is performed to maintain numerical stability in the cascaded modulated reflection feature map. The truncation range is an exemplary implementation parameter and can be adjusted according to the training data distribution.
[0049] In this embodiment, it is possible to Thresholding or clustering segmentation is performed on the dark spot response channels to obtain dark spot connected regions; the ratio of the area of the dark spot connected region to the area of the effective imaging region is calculated to obtain the spatial proportion; simultaneously, the mean response within the dark spot connected region in each channel is calculated to obtain the channel response mean. The spatial proportion is used as a weighting factor to normalize and weight the channel response mean, forming a transmission impurity weight vector. For example, when the... The average response of the dark spot region in each channel is The space ratio of dark spots is At that time, the first The transmission impurity weights of each channel can be expressed as: ; in, To prevent the stability constant from having a denominator of 0, we can take... .
[0050] The transmission impurity weight vector is input into two parallel mapping layers respectively to obtain... and and write If the connected region of the dark spot does not exist, then the spatial proportion will be... Set to 0, and form the result through normal global pooling. and This allows the processing chain to still output the cascaded modulated reflection feature map.
[0051] In this embodiment, channel attention, grouped fully connected mapping, or one-dimensional convolutional mapping can be used instead of ordinary fully connected mapping in the dynamic modulation residual block. The alternative mapping still takes the initial transmission feature map or transmission impurity weight vector as input, still outputs channel-wise scaling coefficients and channel-wise bias coefficients, and still participates in the same affine modulation calculation.
[0052] S105, perform sub-pixel upsampling on the cascaded modulated reflection feature map to obtain a high-resolution feature map, and perform initial pixel classification on the high-resolution feature map to obtain an initial impurity probability map; S105 further includes: The cascaded modulated reflection feature map is converted into a feature map to be rearranged through channel-adaptive convolution. The feature map to be rearranged is subjected to subpixel rearrangement according to a preset magnification ratio to obtain a high-resolution feature map; The high-resolution feature map is input into the initial segmentation convolutional layer to obtain the probability that each pixel belongs to the impurity region, and the probabilities of all pixels are combined to form the initial impurity probability map.
[0053] Specifically, in this embodiment of the invention, the reflection feature map after cascaded modulation First, a channel-adaptive convolutional layer is input, which expands the number of channels to the number required for subpixel rearrangement. For example, when the preset magnification is 2, if the target high-resolution feature map has 64 channels, the number of channels in the feature map to be rearranged can be expanded to... Subpixel rearrangement is used to rearrange local pixel information in the channel dimension to the spatial dimension, resulting in a high-resolution feature map. . The spatial size is a preset magnification factor of the input feature map spatial size, and the number of channels is restored to the target number of channels. Because... Originating from the modulation of transmission characteristics , The impurity candidate regions already carry the channel modulation results of the transmission dark spots on the reflection texture.
[0054] If the spatial size of the feature map to be rearranged cannot be divided evenly by the preset magnification factor, then... Boundary padding is performed to obtain a feature map that meets the sub-pixel rearrangement requirements; after upsampling, the image is cropped back to the target detection region. If the input registered image pair contains non-square cropped regions, the rearrangement size can be calculated according to the width and height directions respectively, and the effective region mask is saved in the output high-resolution feature map. The effective region mask limits the probability output of invalid boundaries during subsequent initial pixel classification and feedback processing.
[0055] For initial pixel classification, the initial segmentation convolutional layer may include consecutive convolutional layers, non-linear activation functions, and single-channel probability output layers. After inputting the initial segmentation convolutional layer, each spatial location outputs a probability that it belongs to the impurity region. The probabilities of all pixels are combined to form the initial impurity probability map. . Space dimensions and same. This serves as a spatial prior for feedback processing. If a region exhibits a feather-edge morphology in its reflection features and a dark spot projection response in its transmission features, the initial pixel classification will be... The probability of this occurring in the middle is relatively high; if a certain area only has the texture of ordinary bird's nest fibers, The probability of this is relatively low. The initial pixel classification results can be used in the loss backpropagation during the training phase, or in the inference phase to form the feedback processing feature map.
[0056] In this embodiment, a probability truncation process can also be added after the initial segmentation convolutional layer. For example, probabilities below 0.05 are set to 0, probabilities above 0.95 are retained as high-confidence candidate regions, and intermediate probability regions continue to participate in subsequent smoothing and upsampling.
[0057] S106, the initial impurity probability map is scaled and smoothed to form an impurity prior attention map, and then applied to the high-resolution feature map by pixel to obtain a feedback processing feature map; S106 further includes: The initial impurity probability map is downsampled to obtain a low-scale probability map; Gaussian smoothing is applied to the low-scale probability map to obtain a smoothed probability map; The smoothed probability map is upsampled to the spatial size of the high-resolution feature map to obtain the impurity prior attention map; The impurity prior attention map is adjusted based on a preset learnable scaling parameter, and the high-resolution feature map is multiplied by a pixel-wise weighted term containing the adjusted impurity prior attention map to obtain a feedback processing feature map.
[0058] Furthermore, adjusting the impurity prior attention map based on preset learnable scaling parameters includes: Dark spot pixel regions are selected from the transmitted light digital image according to preset grayscale conditions. Candidate pixel sets that meet preset probability conditions in the initial impurity probability map are counted. The degree of overlap between the candidate pixel set and the dark spot pixel regions is calculated. When the degree of overlap meets the preset consistency condition, the preset learnable scaling parameter is increased; when the degree of overlap does not meet the preset consistency condition, the preset learnable scaling parameter is decreased, and the feedback processing feature map is recalculated using the adjusted scaling parameter.
[0059] Specifically, in the embodiments of the present invention, Downsampling is performed using strided convolution, average pooling, or max pooling to form a low-scale probability map. Downsampling aggregates local impurity probabilities, weakening isolated noise responses. Gaussian smoothing is then applied to the low-scale probability map to obtain a smoothed probability map. For example, the Gaussian kernel size can be 5×5, and the standard deviation can be 1.0. The smoothed probability map is then upsampled using bilinear interpolation or transposed convolution. Spatial dimensions, forming impurity prior attention maps . The pixel value represents the intensity of the corresponding location participating in the feedback weighting as a priori region of impurities.
[0060] Introducing preset learnable scaling parameters adjust right The intensity of its effect. Feedback processing feature map. It can be represented as: ; in, This represents the feature map of feedback processing. Represents high-resolution feature maps; Represents the impurity prior attention map; This indicates the preset learnable scaling parameters; This indicates pixel-by-pixel multiplication.
[0061] The pixel-by-pixel weighting term is .when When a pixel location has a high value, increase the high-resolution feature response at that location; when When a pixel has a low value, the high-resolution feature response at that location remains close to the original response. The parameters can be updated during the training phase or fixed parameters can be used during inference deployment after training. For example, The initial value can be set to 0.1 and saved in the model parameter file after training.
[0062] In this embodiment, the transmitted light digital image Dark spot pixel regions can be selected by filtering based on gray levels below a preset gray level threshold. This preset gray level threshold can be set according to the gray level histogram quantiles of the transmitted image, for example, taking the 20th quantile of the effective region's gray level. The candidate pixel set can be obtained from... The pixels are composed of those with a probability greater than a preset probability threshold, which can be set to 0.5. The degree of overlap can be calculated using the intersection-over-union ratio (IoU), expressed as: ; in, Represents the set of candidate pixels; Indicates the dark spot pixel area; Indicates the number of pixels in the intersection; This indicates the number of pixels in the union.
[0063] Preset consistency conditions can be: .when This indicates that the initial impurity probability map and the transmission dark spot region have strong spatial consistency, which can... Increase the step size by a small amount, for example ;when This indicates that the initial impurity probability map may contain a large amount of reflective texture response, which can be... Reduce the step size by a small amount, for example Adjusted Re-enter This yields the updated feedback processing feature map. If or If empty, then Set to 0, and decrease or maintain. This prevents subsequent processing from over-amplifying areas lacking transmission support.
[0064] In this embodiment, local mean filtering, bilateral filtering, or morphological opening and closing operations can be used instead of Gaussian smoothing. Furthermore, a partitioned scaling parameter can be used, applying a smaller scaling parameter to areas with thicker bird's nests and weaker transmission dark spot response, and a larger scaling parameter to areas with thinner bird's nests and clearer dark spots. The alternative processing still uses the initial impurity probability map to form an impurity prior attention map, and still applies it pixel-by-pixel to the high-resolution feature map.
[0065] S107, perform image reconstruction and pixel-by-pixel classification on the feedback processing feature map, and output a high-resolution bird's nest reconstruction image and an impurity segmentation mask.
[0066] S107 further includes: The feedback processing feature map is input into the reconstruction residual block and the reconstruction convolutional layer to obtain a high-resolution bird's nest reconstruction image; The feedback processing feature map is input into a pixel classification structure containing downsampling encoding path, upsampling decoding path and cross-layer concatenation path to obtain an impurity probability map; The impurity probability map is processed by a preset threshold and connected component analysis to output an impurity segmentation mask containing the location, outline and size of impurity instances.
[0067] Furthermore, image reconstruction and pixel-by-pixel classification are performed on the feedback processing feature map using parameters trained with a closed-loop interaction loss, the formation of which includes: Obtain the training reconstructed image and the training impurity segmentation mask; The pixel difference between the trained reconstructed image and the high-resolution ground truth image is calculated, and the pixel difference of the impurity region is weighted according to the trained impurity segmentation mask to obtain the super-resolution reconstruction loss. The cross-entropy between the training impurity segmentation mask and the manually labeled mask is calculated to obtain the segmentation loss; The training reconstructed image is re-encoded to obtain a reconstructed reflection feature map. The difference between the reconstructed reflection feature map and the high-resolution feature map is calculated to obtain the cyclic feature alignment loss. The closed-loop interaction loss is obtained by weighted summation of the super-resolution reconstruction loss, the segmentation loss, and the cyclic feature alignment loss.
[0068] Furthermore, obtaining the training reconstructed image and the training impurity segmentation mask includes: The reflected and transmitted images were acquired and registered according to the positioning marks to obtain high-resolution training image pairs; The high-resolution training image pair is downsampled into a low-resolution training image pair, and the reflection image in the high-resolution training image pair is used as the high-resolution ground truth image of reflection. Read the impurity pixel regions in the manually labeled mask, and combine the low-resolution training image pair, the high-resolution ground truth image, and the manually labeled mask to form a training sample.
[0069] Specifically, in this embodiment of the invention, the reconstructed residual block may include a convolutional layer, a nonlinear activation layer, and residual connections. After reconstructing the residual blocks, they are input into the reconstruction convolutional layer, which outputs a high-resolution reconstructed image of the bird's nest. . With high-resolution feature maps With the same spatial dimensions, the pixel channels can be consistent with the reflected light digital image. The pixel classification structure can adopt an encoder-decoder structure. The encoding path extracts high-level contextual features step by step through convolution and downsampling, while the decoding path restores spatial resolution step by step through upsampling. The cross-layer concatenation path concatenates the shallow edge information in the encoding path with the high-level semantic information in the decoding path to form an impurity probability map. After the impurity probability map is processed by a preset threshold, a binary mask is obtained, and then the position, contour, and size of each impurity instance are obtained through connected component analysis. The position of the impurity instance can be represented by the bounding rectangle of the connected component, centroid coordinates, or contour coordinates; the contour can be represented by the boundary pixel sequence; and the size can be represented by the pixel area, major axis length, minor axis length, or equivalent diameter.
[0070] In this embodiment, the training samples can be enhanced by random rotation, flipping, brightness perturbation and cropping. The enhanced reflection image, transmission image and manually labeled mask maintain the same geometric transformation relationship.
[0071] The super-resolution reconstruction loss can be expressed as: ; in, Indicates the loss from over-resolution reconstruction; This represents the reconstructed image from the training image; Represents a high-resolution ground truth image of reflectance; This represents the training impurity segmentation mask or the impurity probability map output during the training phase. This indicates the weight of the loss focused on the impurity region; This represents the summation of absolute errors pixel by pixel; This indicates pixel-by-pixel multiplication.
[0072] The segmentation loss can be expressed as: ; in, Indicates the segmentation loss; Represents the binary cross-entropy; This indicates a manually labeled mask.
[0073] The cyclic feature alignment loss can be expressed as: ; in, Indicates will The reconstructed reflection feature map obtained from the shallow encoder of the reflection flow is input again; Represents high-resolution feature maps; This represents the mean square error.
[0074] The closed-loop interaction loss can be expressed as: ; in, Indicates the closed-loop interaction loss; This represents the weights of the cyclic feature alignment loss.
[0075] For example, 0.5 is acceptable. A value of 0.1 is acceptable. During training, a stochastic gradient-based optimizer is used to update the parameters of the shallow encoder, dynamically modulated residual block, initial segmentation convolutional layer, feedback processing module, reconstruction residual block, reconstruction convolutional layer, and pixel classification structure. When the validation set loss no longer decreases within a preset number of epochs or reaches the preset number of training epochs, the trained parameters are saved. The evaluation process can use evaluation image pairs that do not participate in parameter updates and manually labeled masks to calculate the overlap, boundary distance, or pixel classification error between the segmentation mask and the manually labeled mask. The evaluation results are used to select the parameter file.
[0076] The following describes this embodiment in conjunction with application scenarios: For example, a digital image of reflected light from one area of a bird's nest to be tested is acquired. and transmitted light digital images The original size is 1024×1024 pixels, the reprojection error of the positioning marker is 1.2px, which meets the preset pixel error threshold of 2px, and the registered image pair is output. The registered image pair is downsampled to 512×512 pixels and input into the shallow encoder, and the output is... and The dimensions of both are . Formed by global average pooling The transmission channel statistical vector is output by the parallel mapping layer. and Within a certain dynamic modulation residual block, Size is , and Multiply and superimpose channel by channel get , After being added to the current input reflection feature map, it enters the next dynamic modulation residual block; after processing 8 consecutive dynamic modulation residual blocks, the result is obtained. . Obtained through channel-adaptive convolution The feature map to be rearranged is obtained by rearranging it at twice the sub-pixel level. of and output of In S6, After 2x downsampling, Gaussian smoothing, and upsampling, the following was obtained: If the transmitted dark spot area With candidate pixel set intersection ratio The value is 0.46, which satisfies the condition. If the preset consistency condition is met, then... Adjusted from 0.10 to 0.12, and according to... get . Output after reconstructing residual blocks and reconstructing convolutional layers of The pixel classification structure outputs an impurity probability map. When the preset segmentation threshold is 0.5, binarization and connected component analysis are performed on the impurity probability map to obtain an impurity segmentation mask containing the centroid coordinates, contour point sequence, and pixel area of each impurity instance. This example data is only used to illustrate the processing flow and intermediate data format.
[0077] In this embodiment, the operation log output or status cache reading method can also be set for result verification. For example, the registration transformation relationship and reprojection error are recorded, and the residual of each dynamic modulation block is recorded. mean mean and Response range, record degree of overlap The maximum value of the attention map is recorded, along with the preset segmentation threshold, the number of connected components, and the area of each connected component. The runtime log can be saved as structured text or a binary cache. The debugging interface reads the corresponding intermediate results by image number to verify whether the impurity segmentation mask is gradually formed by the registered image pair, the cascaded modulated reflection feature map, and the feedback processing feature map.
[0078] For the purpose of simplicity, the method steps disclosed in the above embodiments are described as a series of actions. However, those skilled in the art should understand that the embodiments of the present invention are not limited to the described order of actions, because according to the embodiments of the present invention, some steps may be performed in other orders or simultaneously. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are all preferred embodiments, and the actions involved are not necessarily essential to the embodiments of the present invention.
[0079] like Figure 2 As shown, the present invention also provides a pixel-level enhancement and precise segmentation system for fine impurities in bird's nest based on super-resolution reconstruction, comprising: The image registration module 201 is configured to acquire digital images of reflected light and transmitted light of the bird's nest to be tested, and perform pixel registration according to the positioning marks to obtain a registered image pair; The shallow encoding module 202 is configured to encode the reflected light digital image and the transmitted light digital image into a reflection initial feature map and a transmission initial feature map, respectively. The modulation coefficient generation module 203 is configured to perform convolution processing on the input reflection feature map in a preset number of dynamic modulation residual blocks, and to form channel-wise scaling coefficients and channel-wise bias coefficients by pooling and fully connected mapping of the initial transmission feature map. The affine modulation module 204 is configured to perform affine modulation on the convolutional reflection feature map based on the channel-by-channel scaling coefficient and the channel-by-channel bias coefficient to obtain the cascaded modulated reflection feature map. The upsampling and initial classification module 205 is configured to perform sub-pixel upsampling on the cascaded modulated reflection feature map to obtain a high-resolution feature map, and perform initial pixel classification on the high-resolution feature map to obtain an initial impurity probability map. The feedback processing module 206 is configured to transform and smooth the initial impurity probability map to form an impurity prior attention map, and apply it to the high-resolution feature map pixel by pixel to obtain a feedback processed feature map. The output module 207 is configured to perform image reconstruction and pixel-by-pixel classification on the feedback processing feature map, and output a high-resolution bird's nest reconstruction image and an impurity segmentation mask.
[0080] It is worth noting that although only some basic functional modules are disclosed in the embodiments of this invention, it does not mean that the composition of this system is limited to the above-mentioned basic functional modules. On the contrary, based on the above-mentioned basic functional modules, those skilled in the art can arbitrarily add one or more functional modules in combination with existing technology to form an infinite number of embodiments or technical solutions. That is to say, this system is open rather than closed. The fact that this embodiment only discloses a few basic functional modules should not be considered as the scope of protection of this invention being limited to the disclosed basic functional modules. At the same time, for the convenience of description, the above devices are described separately according to their functions as various units and modules. Of course, in implementing this invention, the functions of each unit and module can be implemented in one or more software and / or hardware.
[0081] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for pixel-level enhancement and precise segmentation of fine impurities in bird's nest based on super-resolution reconstruction, characterized in that, include: Digital images of reflected light and transmitted light of the bird's nest to be tested were acquired, and pixel registration was performed according to the positioning marks to obtain registered image pairs; The reflected light digital image and the transmitted light digital image are respectively encoded into an initial reflection feature map and an initial transmission feature map; In a preset number of dynamic modulation residual blocks, the input reflection feature map is convolved, and the initial transmission feature map is pooled and fully connected to form channel-wise scaling coefficients and channel-wise bias coefficients. Based on the channel-by-channel scaling factor and the channel-by-channel bias factor, affine modulation is performed on the convolutional reflection feature map to obtain the cascaded modulated reflection feature map; Subpixel upsampling is performed on the cascaded modulated reflection feature map to obtain a high-resolution feature map, and initial pixel classification is performed on the high-resolution feature map to obtain an initial impurity probability map; The initial impurity probability map is scaled and smoothed to form an impurity prior attention map, which is then applied to the high-resolution feature map pixel by pixel to obtain a feedback processing feature map. Image reconstruction and pixel-by-pixel classification are performed on the feedback processing feature map to output a high-resolution bird's nest reconstruction image and an impurity segmentation mask.
2. The method for pixel-level enhancement and precise segmentation of fine impurities in bird's nest based on super-resolution reconstruction according to claim 1, characterized in that, Digital images of reflected and transmitted light from the bird's nest to be tested are acquired, and pixel registration is performed according to the positioning marks to obtain a registered image pair, which further includes: Digital images of reflected light containing surface texture and impurity details of bird's nest were acquired under reflected illumination, and digital images of transmitted light containing dark spot projections inside bird's nest were acquired under transmitted illumination. Read the pixel coordinates of the transparent stage positioning mark in the reflected light digital image and the transmitted light digital image, and calculate the image registration transformation relationship; Resample the transmitted light digital image or the reflected light digital image according to the image registration transformation relationship to obtain a spatially consistent registered image pair.
3. The method for pixel-level enhancement and precise segmentation of fine impurities in bird's nest based on super-resolution reconstruction according to claim 1, characterized in that, Encoding the reflected light digital image and the transmitted light digital image into an initial reflection feature map and an initial transmission feature map, respectively, further includes: Convolution and nonlinear activation are performed on the reflected light digital image to obtain an initial reflection feature map containing the surface texture of the bird's nest and the reflection edges of impurities; Convolution and nonlinear activation are performed on the transmitted light digital image to obtain an initial transmission feature map containing the projection positions of impurity dark spots; The initial reflection feature map is fed into the reflection branch of the dynamic modulation residual block, and the initial transmission feature map is maintained as the modulation signal of each dynamic modulation residual block.
4. The method for pixel-level enhancement and precise segmentation of fine impurities in bird's nest based on super-resolution reconstruction according to claim 1, characterized in that, Based on the channel-by-channel scaling factor and the channel-by-channel bias factor, affine modulation is performed on the convolutional reflection feature map to obtain a cascaded modulated reflection feature map, which further includes: Perform convolution on the current input reflection feature map to obtain an intermediate reflection feature map; Global pooling is performed on the initial transmission feature map to obtain the transmission channel statistical vector; The transmission channel statistical vector is mapped to a channel-by-channel scaling factor and a channel-by-channel bias factor; Based on the channel-by-channel scaling factor and the channel-by-channel bias factor, a channel-by-channel affine transformation is performed on the intermediate reflection feature map to obtain the current modulation feature map; Perform a residual connection between the current modulation feature map and the current input reflection feature map, and send the residual connection result to the next dynamic modulation residual block until the cascaded modulation reflection feature map is obtained.
5. The method for pixel-level enhancement and precise segmentation of fine impurities in bird's nest based on super-resolution reconstruction according to claim 1, characterized in that, Subpixel upsampling is performed on the cascaded modulated reflection feature map to obtain a high-resolution feature map. Initial pixel classification is then performed on the high-resolution feature map to obtain an initial impurity probability map. This further includes: The cascaded modulated reflection feature map is converted into a feature map to be rearranged through channel-adaptive convolution. The feature map to be rearranged is subjected to subpixel rearrangement according to a preset magnification ratio to obtain a high-resolution feature map; The high-resolution feature map is input into the initial segmentation convolutional layer to obtain the probability that each pixel belongs to the impurity region, and the probabilities of all pixels are combined to form the initial impurity probability map.
6. The method for pixel-level enhancement and precise segmentation of fine impurities in bird's nest based on super-resolution reconstruction according to claim 1, characterized in that, The initial impurity probability map is scaled and smoothed to form an impurity prior attention map, which is then applied pixel-by-pixel to the high-resolution feature map to obtain a feedback processing feature map, further comprising: The initial impurity probability map is downsampled to obtain a low-scale probability map; Gaussian smoothing is applied to the low-scale probability map to obtain a smoothed probability map; The smoothed probability map is upsampled to the spatial size of the high-resolution feature map to obtain the impurity prior attention map; The impurity prior attention map is adjusted based on a preset learnable scaling parameter, and the high-resolution feature map is multiplied by a pixel-wise weighted term containing the adjusted impurity prior attention map to obtain a feedback processing feature map.
7. The method for pixel-level enhancement and precise segmentation of fine impurities in bird's nest based on super-resolution reconstruction according to claim 1, characterized in that, The feedback processing feature map is used to perform image reconstruction and pixel-by-pixel classification, outputting a high-resolution bird's nest reconstruction image and an impurity segmentation mask, further including: The feedback processing feature map is input into the reconstruction residual block and the reconstruction convolutional layer to obtain a high-resolution bird's nest reconstruction image; The feedback processing feature map is input into a pixel classification structure containing downsampling encoding path, upsampling decoding path and cross-layer concatenation path to obtain an impurity probability map; The impurity probability map is processed by a preset threshold and connected component analysis to output an impurity segmentation mask containing the location, outline and size of impurity instances.
8. The method for pixel-level enhancement and precise segmentation of fine impurities in bird's nest based on super-resolution reconstruction according to claim 1, characterized in that, Image reconstruction and pixel-by-pixel classification are performed on the feedback processing feature map using parameters trained with a closed-loop interaction loss. The formation of the closed-loop interaction loss includes: Obtain the training reconstructed image and the training impurity segmentation mask; The pixel difference between the trained reconstructed image and the high-resolution ground truth image is calculated, and the pixel difference of the impurity region is weighted according to the trained impurity segmentation mask to obtain the super-resolution reconstruction loss. The cross-entropy between the training impurity segmentation mask and the manually labeled mask is calculated to obtain the segmentation loss; The training reconstructed image is re-encoded to obtain a reconstructed reflection feature map. The difference between the reconstructed reflection feature map and the high-resolution feature map is calculated to obtain the cyclic feature alignment loss. The closed-loop interaction loss is obtained by weighted summation of the super-resolution reconstruction loss, the segmentation loss, and the cyclic feature alignment loss.
9. The method for pixel-level enhancement and precise segmentation of fine impurities in bird's nest based on super-resolution reconstruction according to claim 8, characterized in that, Obtaining the training reconstructed image and the training impurity segmentation mask, further including: The reflected and transmitted images were acquired and registered according to the positioning marks to obtain high-resolution training image pairs; The high-resolution training image pair is downsampled into a low-resolution training image pair, and the reflection image in the high-resolution training image pair is used as the high-resolution ground truth image of reflection. Read the impurity pixel regions in the manually labeled mask, and combine the low-resolution training image pair, the high-resolution ground truth image, and the manually labeled mask to form a training sample.
10. A pixel-level enhancement and precise segmentation system for fine impurities in bird's nest based on super-resolution reconstruction, characterized in that, include: The image registration module is configured to acquire digital images of reflected light and transmitted light of the bird's nest to be tested, and perform pixel registration according to the positioning marks to obtain a registered image pair; The shallow coding module is configured to encode the reflected light digital image and the transmitted light digital image into a reflection initial feature map and a transmission initial feature map, respectively. The modulation coefficient generation module is configured to perform convolution processing on the input reflection feature map in a preset number of dynamic modulation residual blocks, and to generate channel-wise scaling coefficients and channel-wise bias coefficients by pooling and fully connected mapping of the initial transmission feature map. The affine modulation module is configured to perform affine modulation on the convolutional reflection feature map based on the channel-by-channel scaling coefficient and the channel-by-channel bias coefficient to obtain the cascaded modulated reflection feature map. The upsampling and initial classification module is configured to perform sub-pixel upsampling on the cascaded modulated reflection feature map to obtain a high-resolution feature map, and perform initial pixel classification on the high-resolution feature map to obtain an initial impurity probability map; The feedback processing module is configured to scale and smooth the initial impurity probability map to form an impurity prior attention map, and then apply it to the high-resolution feature map pixel by pixel to obtain the feedback processed feature map. The output module is configured to perform image reconstruction and pixel-by-pixel classification on the feedback processing feature map, and output a high-resolution bird's nest reconstruction image and an impurity segmentation mask.
