Light-weight crop image super-resolution and disease identification method and system

By constructing an enhanced super-resolution generation adversarial network and model distillation technology, the problems of insufficient crop image resolution and high demand for model computing resources are solved, and crop image super-segment and disease recognition that operates efficiently on resource-constrained devices are realized.

CN119478709APending Publication Date: 2025-02-18EAST CHINA JIAOTONG UNIVERSITY

Patent Information

Application Number
CN202510058887.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-15
Publication Date
2025-02-18

AI Technical Summary

Technical Problem

In the prior art, crop image resolution is insufficient, and the detailed characteristics of crop leaves cannot be effectively captured, resulting in poor disease recognition effect. The model parameters of the super-score method based on deep learning are huge, and the computing resource demand is high, making it difficult to be limited by resources. running effectively on the device.

Method used

A method for lightweight crop image super-segment and disease recognition is proposed. By constructing an enhanced super-resolution generation adversarial network and model distillation technology, the number of model parameters and calculation needs are reduced, and the operation efficiency of the model on resource-constrained equipment is improved.

Benefits of technology

While maintaining image enhancement performance, the number of model parameters and calculation requirements are significantly reduced, so that high-quality crop image super-segment tasks can be efficiently run on resource-constrained equipment to meet the needs of disease detection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119478709A_ABST
    Figure CN119478709A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of computer vision, in particular to a light-weight crop image super-resolution and disease identification method and a light-weight crop image super-resolution and disease identification system. Comprising the steps of extracting crop disease images in a database as a data set; preprocessing the data set, and training a disease recognition model according to a deep convolutional neural network; then training an image super-division model; distilling the image super-division model to obtain a lightweight student model; obtaining a target crop image and carrying out image preprocessing; and carrying out image super-division on the target crop image, and completing disease identification of the target crop based on the disease identification model. According to the invention, the generative adversarial network and the model distillation means are constructed in a combined manner, the generator and the discriminator are used for continuous adversarial learning, and the model distillation is used for transferring knowledge from a large-scale and complex teacher model to a small-scale and efficient student model; therefore, the number of parameters and calculation requirements of the model are significantly reduced while the image enhancement performance is maintained.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer vision technology, and in particular to a method and system for lightweight crop image super-resolution and disease recognition. Background Art

[0002] In modern agricultural production, early detection and diagnosis of crop diseases are crucial to ensure crop health and increase yields. In terms of crop disease monitoring, disease recognition based on leaf images is widely used and effective. At present, most image recognition models are trained based on high-quality clear pictures. These pictures are usually taken in a well-controlled environment with high resolution and rich detail information. However, in practical applications, due to the limitation of resolution, the detailed information of the leaves taken by farmers is often not clear enough, and it is impossible to effectively capture enough features for accurate recognition, and the recognition effect is often greatly reduced.

[0003] Image super-resolution technology aims to improve the resolution of images and restore the detailed information of images through algorithms. By improving the resolution of images, microscopic features such as lesions and color changes on crop leaves can be better observed and analyzed, which are crucial for disease diagnosis. The current mainstream image super-resolution technologies include interpolation methods, reconstruction-based methods, and deep learning-based methods. Among them, interpolation methods have problems such as distortion and poor edge processing. Reconstruction-based methods are sensitive to noise and lack global consistency. Super-resolution methods based on deep learning, such as Super-Resolution Convolutional Neural Network (SRCNN), Super-Resolution Residual Network (SRResNet), and Very Deep Super-Resolution (VDSR), are widely recognized for their excellent performance. However, these methods often require high computing resources due to their large number of model parameters and limited generalization capabilities, and cannot achieve good results on some lower-end devices or edge devices with less computing resources. Summary of the invention

[0004] The present invention aims to at least improve one of the technical problems existing in the prior art. To this end, the present invention proposes a method and system for lightweight crop image super-resolution and disease recognition.

[0005] The method for lightweight crop image super-resolution and disease recognition according to the first aspect of the present invention includes: Extract crop disease images from the database as a dataset; Preprocess the data set, build a deep convolutional neural network with enhanced super-resolution generative adversarial network, and train the disease recognition model based on the deep convolutional neural network; Training an image super-resolution model based on the dataset and an enhanced super-resolution generative adversarial network; Distill the image super-resolution model to obtain a lightweight student model; Acquire target crop images and perform image preprocessing; The target crop image is super-resolved according to the lightweight student model, and the disease identification of the target crop is completed based on the disease identification model. In a possible implementation manner of the first aspect, preprocessing the data set includes: Degrading the crop disease image to obtain a degraded image, wherein the degradation process includes blurring, scaling, adding noise, and Joint Photographic Experts Group (JPEG) compression, etc.; Adding Gaussian noise to the degraded image to simulate random noise interference, outputting pixel values ​​of the image and controlling the pixel values ​​within a first preset range; Changing the brightness of the image, randomly generating a gamma value within a second preset range, and applying the gamma value to the image; Flip the image; Adjust the contrast of the image and set a contrast factor greater than 1 to enhance the contrast of the image to obtain a Class I image.

[0006] Through the above data preprocessing and enhancement techniques, such as rotation, flipping, and color adjustment, the generalization ability of the model can be increased, so that the model can still maintain a high recognition accuracy when facing images captured under different conditions. Adding Gaussian noise can simulate the random noise interference in the image capture process in the real world, which helps the model learn to accurately recognize in the presence of noise and improves the robustness of the model.

[0007] In a possible implementation manner of the first aspect, training the disease recognition model according to the deep convolutional neural network is specifically: The enhanced super-resolution generative adversarial network includes a generator and a discriminator, and model training is performed on the generator and the discriminator respectively; According to the generator, feature extraction is performed on the class I images in the data set to generate a reconstructed image; The reconstructed image and the original image are discriminated according to the discriminator to obtain a discrimination result; The loss function is set according to the discrimination result, and the discriminator and the generator are tuned, wherein the loss function of the generator is: , in, and are all parameters, G is the generator model, is the perceived loss, It is pixel level loss.

[0008] In a possible implementation manner of the first aspect, the image super-resolution model is distilled to obtain a lightweight student model as follows: The trained image super-resolution model is used as the teacher model to build a student model. During the training process, the teacher model generates soft target outputs for the input samples. The loss function of the student model includes reconstruction loss and distillation loss. Feature distillation loss is used to measure the difference between the intermediate layer features of the student model and the features of the teacher model and to update the student model parameters through the back-propagation algorithm.

[0009] Use the optimizer to adjust the training parameters of the student model according to the loss function, including the learning rate and loss weight. By adjusting the learning rate, convergence is accelerated and model performance is improved. By adjusting the weight parameters, the student model's learning of the true label and the teacher's output is balanced, and the focus on the true label is increased to ensure that the student model ultimately has a high generalization ability.

[0010] In a possible implementation manner of the first aspect, acquiring the target crop image and performing image preprocessing specifically includes: Denoise the image and use non-local mean denoising to reduce image noise while preserving the edges and details of the image; Adjust the brightness of the image by using adaptive histogram equalization; Normalize the image size and resize it using bilinear interpolation.

[0011] In a possible implementation manner of the first aspect, denoising the image specifically includes: For each pixel in the image, find similar blocks of pixels in the neighborhood; Calculate the average value of all pixel values ​​in the pixel block; The original value of each pixel is replaced by the calculated average value, thereby removing noise and completing a single denoising process; The above denoising process is repeated until a predetermined denoising number is reached or a preset stop condition is met.

[0012] In a possible implementation manner of the first aspect, flipping the image includes horizontal flipping or vertical flipping.

[0013] According to the method for lightweight crop image super-resolution and disease recognition of an embodiment of the present invention, by combining the construction of a generative adversarial network and a model distillation method, the generator and the discriminator are continuously adversarially learned, and the model distillation is used to transfer knowledge from a large and complex teacher model to a small and efficient student model, thereby significantly reducing the number of model parameters and computing requirements while maintaining image enhancement performance, so that high-quality crop image super-resolution tasks can be efficiently run on resource-constrained devices to meet the needs of disease detection.

[0014] According to the system for lightweight crop image super-resolution and disease recognition in the second embodiment of the present invention, An extraction module, used to extract crop disease images in the database as a data set; A first preprocessing module, used for preprocessing the data set; Building blocks for constructing deep convolutional neural networks with enhanced super-resolution generative adversarial networks; The first training module is used to train a disease recognition model based on a deep convolutional neural network; A second training module is used to train an image super-resolution model based on the data set and an enhanced super-resolution generative adversarial network; The rectification module is used to distill the image super-resolution model to obtain a lightweight student model; A second preprocessing module is used to obtain target crop images and perform image preprocessing; The image super-resolution module is used to perform image super-resolution on the target crop image according to a lightweight student model, and complete disease recognition of the target crop based on a disease recognition model. A computer device according to a third embodiment of the present invention includes a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the method for lightweight crop image super-resolution and disease identification as described above is implemented.

[0015] According to a computer storage medium of an embodiment of the fourth aspect of the present invention, instructions are stored in the computer storage medium, and when the instructions are executed on a computer, the computer executes the method for lightweight crop image super-resolution and disease identification as described above.

[0016] Additional aspects and advantages of the present invention will be given in part in the following description and in part will be obvious from the following description, or will be learned through practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0018] Figure 1 is a flow chart of a method for lightweight crop image super-resolution and disease recognition according to an embodiment of the present invention; Figure 2 2 is a comparison diagram of effects according to an embodiment of the present invention. DETAILED DESCRIPTION

[0019] The embodiments of the present invention are described in detail below. The embodiments described with reference to the accompanying drawings are exemplary. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0020] It should be noted that when an element is referred to as being "fixed to" another element, it may be directly on the other element or there may be an intermediate element. When an element is considered to be "connected to" another element, it may be directly connected to the other element or there may be an intermediate element at the same time.

[0021] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which the present invention belongs. The terms used herein in the specification of the present invention are only for the purpose of describing specific embodiments and are not intended to limit the present invention. The term "and / or" used herein includes any and all combinations of one or more of the related listed items.

[0022] The terms "first", "second", "third", etc. in the specification and claims of the present application and the drawings are used to distinguish different objects rather than to describe a specific order. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a series of steps or units are included, or optionally, steps or units not listed are included, or optionally, other steps or units inherent to these processes, methods, products or devices are included.

[0023] Only the part relevant to the present application is shown in the accompanying drawings, but not all of the content. Before discussing the exemplary embodiments in more detail, it should be mentioned that some exemplary embodiments are described as processing or methods depicted as flow charts. Although the flow chart describes each operation (or step) as a sequential process, many of the operations therein can be implemented in parallel, concurrently or simultaneously. In addition, the order of each operation can be rearranged. When its operation is completed, the process can be terminated, but it can also have additional steps not included in the accompanying drawings. The process can correspond to a method, function, procedure, subroutine, subprogram, etc.

[0024] The terms "component", "module", "system", "unit", etc. used in this specification are used to represent computer-related entities, hardware, firmware, a combination of hardware and software, software, or software in execution. For example, a unit can be, but is not limited to, a process running on a processor, a processor, an object, an executable file, an execution thread, a program, and / or distributed between two or more computers. In addition, these units can be executed from various computer-readable media having various data structures stored thereon. Units can communicate through local and / or remote processes, for example, based on signals having one or more data packets (e.g., data from a second unit interacting with another unit in a local system, a distributed system, and / or a network. For example, the Internet interacts with other systems via signals).

[0025] Example 1 See also Figure 1 As shown, this embodiment provides a method for lightweight crop image super-resolution and disease recognition, which includes: Step S100, extracting crop disease images from a database as a data set; Step S200, preprocessing the data set, constructing a deep convolutional neural network including an enhanced super-resolution generative adversarial network, and training a disease recognition model according to the deep convolutional neural network; Step S300, generating an adversarial network training image super-resolution model according to the data set and the enhanced super-resolution; Step S400, distilling the image super-resolution model to obtain a lightweight student model; Step S500, acquiring a target crop image and performing image preprocessing; Step S600, performing image super-resolution on the target crop image according to the lightweight student model, and completing disease recognition of the target crop based on the disease recognition model. It should be noted that, in step S200, the preprocessing of the data set includes: Degrading the existing high-definition crop leaf disease images in the database to obtain degraded images, wherein the degradation processing includes using operations such as blurring, scaling, noise addition, and JPEG compression; Adding Gaussian noise to the degraded image to simulate random noise interference in the image capture process, and outputting an image with pixel values ​​controlled within a first preset range. In this embodiment, the first preset range is [0, 255]; Changing the brightness of the image, randomly generating a gamma value within a second preset range, and applying the gamma value to the image. In this embodiment, the second preset range is 0.5 to 1.5; Flipping the image after the brightness is changed, wherein the flipping includes horizontal flipping or vertical flipping; Adjust the contrast of the flipped image and set a contrast factor greater than 1 to enhance the contrast of the image to obtain a Class I image.

[0026] It should be noted that step S200 also includes: Construct a deep convolutional neural network (ResNet50), including the initial convolution layer, residual blocks (ResidualBlocks), global average pooling layer, fully connected layer and soft maximum transfer (Softmax) layer.

[0027] The initial convolution layer uses a 7×7 convolution kernel, 64 filters, a stride of 2, and 3 pixels of padding to extract image features and maintain the image size. This is followed by a batch normalization (BN) layer to normalize the output of the convolution layer, accelerate network training and improve generalization capabilities, and use the ReLU (Rectified Linear Unit) activation function to introduce nonlinearity. Finally, a maximum pooling layer is used with a 3×3 pooling kernel and a stride of 2 to further reduce the size of the feature map.

[0028] Residual Blocks consists of a convolutional layer, a batch normalization layer, and a ReLU activation layer. It uses a 1×1 convolutional layer for dimensionality reduction, a 3×3 convolutional layer for feature extraction, and a 1×1 convolutional layer for dimensionality increase. It also uses a shortcut connection to skip the intermediate convolutional layer and directly add the input to the output. Each convolutional layer is followed by a batch normalization layer to normalize the features. Except for the last convolutional layer, each convolutional layer is followed by a ReLU activation function. The final output is the sum of the output of the convolutional layer and the shortcut output, forming a residual connection.

[0029] The global average pooling layer compresses the spatial dimension of each channel of the feature map into a single value, generating a global feature vector.

[0030] The fully connected layer and the Softmax layer are used to map the global feature vector to the number of categories and calculate the probability of each category for the final classification decision.

[0031] It should be noted that the disease recognition model trained based on the deep convolutional neural network is specifically: The enhanced super-resolution generative adversarial network (Real-ESRGAN) includes a generator and a discriminator, and model training is performed on the generator and the discriminator respectively; specifically, the following steps are performed: Construct a generator, which consists of 23 residual in residual dense (RRDB) blocks and 1 upsample block. Finally, the convolution layer is used to convert the number of channels into three outputs.

[0032] Construct an RRDB block, which is composed of three residual dense blocks (RDB) connected together. The convolution layer inside the RDB block extracts image features, and the residual connection alleviates the gradient vanishing problem and enhances the network learning ability. Introducing a scaling factor in the residual connection helps control the gradient flow and enhance the stability of network training.

[0033] To build an RDB block, we first pass through an initial convolutional layer with num_feat feature maps, and then apply the LeakyReLU activation function. Each subsequent convolutional layer then concatenates its output with the outputs of all previous layers to form a dense connection. The output of the first convolutional layer (which has num_grow_ch feature maps) is concatenated with the input and then passes through a second convolutional layer, whose output is again concatenated with the outputs of all previous layers to form num_feat+num_grow_ch feature maps. This process is repeated, with the output of each convolutional layer concatenated with the outputs of all previous layers until we finally pass through the last convolutional layer, which reduces the number of feature maps back to num_feat. After each convolutional layer, a LeakyReLU activation function is applied, and after the last convolutional layer, there is a multiplication by 0.2 to control the scale of the feature map. Finally, the output of the RDB block is added to the input to form a residual connection.

[0034] Construct an upsample block, which consists of 2 upsample layers and 2 convolution layers. The upsample layer increases the image size and performs feature fusion to retain detail information. The upsampled image is further refined through the convolution layer to remove possible artifacts and enhance the texture and details of the image. During the upsampling process, the size of the feature map is first enlarged by the nearest neighbor interpolation method. The interpolated feature map will pass through three convolution layers in sequence: convolution upsampling (conv_up) 1, convolution upsampling (conv_up) 2, and high-resolution convolution (conv_hr). Each convolution layer uses a two-dimensional convolution layer (nn.Conv2d), and the num_feat parameter is used to specify the number of feature maps for the input and output of the convolution layer. The convolution kernel size is 3×3, the stride is 1, and the padding is 1. This design can keep the spatial size of the feature map unchanged.

[0035] Each convolutional layer is followed by a LeakyReLU activation function, which is applied with a negative slope of 0.2 and the inplace parameter is true (inplace=1), which means that the activation function will be calculated in-place, reducing memory usage. The LeakyReLU activation function allows a small part of the gradient to be passed when the input is negative, which helps alleviate the gradient vanishing problem and allows the network to train deeper network structures. Finally, the final convolutional layer (conv_last) reduces the number of feature maps from num_feat to the number of output channels num_out_ch (num_out_ch is the number of output channels), which usually corresponds to the number of color channels of the target image (for example, for RGB images, num_out_ch is usually 3). This last convolutional layer is also followed by a LeakyReLU activation function, outputting the final upsampled image.

[0036] Build the Discriminator. The discriminator uses a U-Net with spectral normalization, which consists of 1 downsampling block, 3 upsampling blocks and an output layer, and finally restores the image to its original size through 3 convolutional layers. The discriminator can evaluate the authenticity of the image at multiple scales and can provide detailed feedback to the generator to improve the quality of the generated image.

[0037] Construct a downsample block consisting of 3 convolutional layers. The initial convolutional layer uses a 3×3 convolution kernel and a stride of 1, without padding, to keep the spatial size of the feature map unchanged. Then spectral normalization and LeakyReLU are introduced to stabilize the training process and introduce nonlinearity. The output feature map passes through a convolutional layer with a stride of 2 to halve the spatial size of the feature map and double the number of feature channels. This convolutional layer is also followed by spectral normalization and LeakyReLU activation functions. After this, the feature map continues to halve the spatial size and double the number of channels by using a 4×4 convolution kernel and a convolutional layer with a stride of 2.

[0038] Construct an upsampling block Upsample, use the nearest neighbor interpolation method to double the spatial size of the feature map, and then introduce nonlinearity through a LeakyReLU activation function. Then, a convolution layer with a 3×3 convolution kernel and a step size of 1 is used to further refine and adjust the upsampled features. Spectral normalization and the application of the LeakyReLU activation function are used to maintain stable training and introduce nonlinearity. At the same time, a residual connection is introduced to add the feature map in the downsampling path to the feature map of the corresponding layer in the upsampling path, retaining image detail information and enhancing the expressiveness of the feature map.

[0039] According to the generator, feature extraction is performed on the Class I (low-resolution) images in the data set to generate a reconstructed image; Image input generator, the initial convolution layer extracts the basic features of the image and increases the depth of the feature map. The constructed RRDB block is then used to fuse and transfer the features. Multiple RDB blocks are densely connected so that the output of each block is the input of all subsequent blocks, allowing the network to transfer and fuse features between different layers and capture richer image representations. After the feature map is processed by a series of residual dense blocks, its spatial resolution is gradually increased through an upsampling layer, and the details of the feature map are retained using the nearest neighbor interpolation method. After each upsampling, a convolution layer follows to refine the upsampled feature map, eliminate possible blocky effects or jagged edges, and further enhance the details and texture of the image. After multiple upsampling and refinement, the feature map is finally converted into a high-resolution image with three channels (corresponding to RGB) through a convolution layer.

[0040] The reconstructed image and the high-resolution original image of the image are discriminated according to the discriminator to obtain a discrimination result; The discriminator extracts features of the input image through the initial convolutional layer, identifying edges, textures, and other visual features in the image. The spatial size of the image is then gradually reduced through the downsampling block, while increasing the depth of the feature map. During the downsampling process, the discriminator extracts features of the image, which include texture, edges, and other visual information. The image then passes through the upsampling block, which uses nearest neighbor interpolation to increase the spatial size of the feature map to approach or reach the size of the target high-resolution image. The upsampled feature map passes through a series of convolutional layers to refine the feature map and enhance the details and texture information of the image. During the upsampling process, the feature map of the upsampling layer is combined with the feature map of the corresponding layer in the downsampling path through jump connections, which helps the discriminator to utilize rich feature information at different scales and improve its sensitivity to image details. After a series of upsampling and feature fusion, the feature map is processed through the final convolutional layer and is ready to output the discriminant result. The last layer is a single-channel convolutional layer that converts the feature map into a scalar value representing the probability that the image is a real image.

[0041] The loss function is set according to the discrimination result, and the discriminator and the generator are tuned, wherein the loss function of the generator is: , in, and All are parameters, The default value is 0. The default value is 1, G is the generator model, is pixel-level loss; For the loss function (GANLoss) used in the Generative Adversarial Network (GAN), the output of the generator model is fed into the discriminant model, and the result and label are used to calculate the Binary Cross Entropy Loss (BCELoss), as follows: .

[0042] Represents the score of the true label of the i-th sample.

[0043] : The output of the discriminator for the i-th sample, which represents the probability that the discriminator believes that the input is a real image.

[0044] : The i-th input sample, which can be a real image or a generated image.

[0045] For perceptual loss, the ground truth (GT) and the output of the generator model are fed into the pre-trained Visual Geometry Group 19th version network (VGG19 model) respectively. , , , , The data of the Conv layer, where the parameters of each Conv layer are (x1, x2, x3, x4), x1 is the batch size, which refers to the number of images processed simultaneously during a forward propagation process; x2 is the number of feature channels, indicating that the feature map output by the convolution layer has x2 channels; x3 is the height of the feature map, and x4 is the width of the feature map, that is, after the image of batch size x1 is processed by the convolution layer, the feature map obtained has x2 channels, and each channel is a two-dimensional array of x3 pixels high and x4 pixels wide. This means that each input image will be converted into x2 feature maps of x3×x4 size after passing through the convolution layer, and there are x1 such feature maps in the entire batch.

[0046] Then use the output of the VGG19 model to calculate the mean absolute error ( LOSS), the formula is as follows: , For the VGG19 model, is the i-th input sample, is the label of the i-th sample.

[0047] : The output of the GT and generator models is directly calculated LOSS, the formula is as follows: .

[0048] Discriminator loss function: (1) The ability to distinguish the true value, construct a matrix with all 1s , used to identify this as a sample for the "ability to distinguish the true". Each sample indicator is set to a maximum score of 1, indicating that the indicator has reached the optimal state. Then calculate the difference between the actual score obtained on a sample i and the sample indicator and The BCELoss (binary cross entropy) formula is as follows: , in, : Represents the loss of the discriminator's ability to distinguish the true (Discriminator Loss), which is the total loss calculated based on the performance of the discriminator on all samples.

[0049] represents the score of the true label of the i-th sample, since It is a matrix filled with all 1s, so it represents the maximum score 1 that the discriminator should give for each sample.

[0050] (2) The ability to distinguish false and construct a set of all zeros ,in is the false label generated by the generator model, which is a matrix filled with all 0s to identify that this is a sample for the "ability to distinguish fakes". The base score of each sample is 0. The actual score of an individual or object on these samples will depend on their performance. If they perform poorly in some aspect, they may get a low score or 0 on the sample. Then calculate the difference between the actual score obtained on a sample i and the sample index and The BCELoss is as follows: , in, is the loss of the discriminator's ability to distinguish fakes (Discriminator Loss), is the fraction of false labels for the i-th sample.

[0051] It should be noted that the image super-resolution model is distilled to obtain a lightweight student model as follows: The trained image super-resolution model is used as the teacher model, and the student model is trained using low-resolution images and the original high-definition images of the low-resolution images. A simplified generator is constructed, and the student model is trained using the same dataset as the teacher model. During the training process, the teacher model generates soft target outputs for the input samples, and the loss function of the student model includes reconstruction loss and distillation loss. The reconstruction loss is used to measure the difference between the output generated by the student model and the true target output, and the distillation loss is used to measure the difference between the student model output and the soft target output of the teacher model.

[0052] Feature distillation loss is used to measure the difference between the intermediate layer features of the student model and the features of the teacher model, and the parameters of the student model in each training step are updated through the back-propagation algorithm; the knowledge of the teacher model is gradually learned to improve its performance in image super-resolution tasks.

[0053] Use an optimizer (such as Adam or SGD) to adjust the training parameters of the student model according to the loss function, including the learning rate and loss weight. By adjusting the learning rate, convergence is accelerated and model performance is improved. By adjusting the weight parameters, the student model's learning of the true label and the teacher's output is balanced, and the focus on the true label is increased to ensure that the student model ultimately has a high generalization ability.

[0054] Student model objective function: , in, represents the knowledge distillation loss, represents the loss function, represents the i-th input sample, represents the feature representation of the teacher model for the i-th input sample, Represents the feature representation of the student model for the i-th input sample.

[0055] Overall loss function: , in, represents the overall loss function, is the penalty coefficient, represents the data supervision loss, represents the teacher similarity loss, represents the attention distillation loss.

[0056] Teacher Supervision Formula: , in, represents the teacher similarity loss, i represents the index of the sample, represents the output of the student model after super-resolution processing of the i-th low-resolution input image, represents the feature representation generated by the teacher model on the i-th sample, and N is the total number of samples in the batch.

[0057] Data supervision formula: , in represents the data supervision loss, represents the output of the student model after super-resolution processing of the i-th low-resolution input image, is the true high-resolution image of the i-th sample, that is, the ground truth, and N is the total number of samples in the batch.

[0058] It should be noted that the acquisition of the target crop image and image preprocessing specifically includes: Denoise the image and use non-local means denoising to reduce image noise while preserving the edges and details of the image.

[0059] In an image, blocks of pixels with similar textures tend to have similar grayscale values. Denoising is achieved by following the steps below: For each pixel in the image, the algorithm looks for similar blocks of pixels in its neighborhood, which typically define similarity based on the grayscale value and / or color of the pixels.

[0060] Once similar pixel blocks are found, the average value of all pixel values ​​in the pixel block is calculated, and this average value is regarded as the "clean" (denoised) value of the pixel; The original value of each pixel is replaced by the calculated average value, thereby removing noise and completing a single denoising process; The above denoising process is repeated until a predetermined denoising number is reached or a preset stop condition is met.

[0061] Adjust the brightness of the image using Contrast Limited Adaptive Histogram Equalization. Specifically, the image is divided into multiple small areas, and each small area is subjected to histogram equalization to enhance the local contrast. At the same time, a contrast limiting factor is introduced to control the amount of contrast increase during the local equalization process. For each pixel, the difference between its equalized value and the adjacent pixel is calculated. If the difference exceeds the preset threshold, the value of the pixel is adjusted to meet the contrast limit condition.

[0062] The image is normalized and resized using bilinear interpolation. During the scaling process, for each pixel position in the new image, bilinear interpolation selects the four closest pixels in the original image. A weight is calculated for each point based on the relative distance between the new pixel position and the four known pixels. The values ​​of the four known pixels are then multiplied by their corresponding weights, and these products are added together to get an estimate of the new pixel.

[0063] The method of this embodiment is used to identify crop disease images, and the results are as follows: Figure 2 As shown, Figure 2 (a) is the original image without using the method of this embodiment to perform disease image recognition. Figure 2 (b) is a diagram showing the effect of crop disease image recognition using the method of this embodiment. It can be seen that the recognition effect of this embodiment is better and can perform high-quality crop image super-resolution tasks to meet the needs of disease detection.

[0064] In addition, experimental tests have shown that the accuracy of crop disease recognition using the method of this embodiment is as high as 80%, which has a more significant disease recognition capability compared to the existing original image recognition.

[0065] According to the method for lightweight crop image super-resolution and disease recognition of an embodiment of the present invention, by combining the construction of a generative adversarial network and a model distillation method, the generator and the discriminator are continuously adversarially learned, and the model distillation is used to transfer knowledge from a large and complex teacher model to a small and efficient student model, thereby significantly reducing the number of model parameters and computing requirements while maintaining image enhancement performance, so that high-quality crop image super-resolution tasks can be efficiently run on resource-constrained devices to meet the needs of disease detection.

[0066] Example 2 This embodiment provides a lightweight crop image super-resolution and disease recognition system, wherein: An extraction module, used to extract crop disease images in the database as a data set; A first preprocessing module, used for preprocessing the data set; Building blocks for constructing deep convolutional neural networks with enhanced super-resolution generative adversarial networks; The first training module is used to train a disease recognition model based on a deep convolutional neural network; A second training module is used to train an image super-resolution model based on the data set and an enhanced super-resolution generative adversarial network; The rectification module is used to distill the image super-resolution model to obtain a lightweight student model; A second preprocessing module is used to obtain target crop images and perform image preprocessing; The image super-resolution module is used to perform image super-resolution on the target crop image according to a lightweight student model, and complete disease recognition of the target crop based on a disease recognition model. Example 3 This embodiment provides a computer device, which includes a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the method for lightweight crop image super-resolution and disease identification as described above is implemented.

[0067] Example 4 This embodiment provides a computer storage medium, wherein the computer storage medium stores instructions, and when the instructions are executed on a computer, the computer executes the above-mentioned method for lightweight crop image super-resolution and disease identification.

[0068] In the description of the present invention, it is to be understood that the terms “center”, “longitudinal”, “lateral”, “length”, “width”, “thickness”, “up”, “down”, “front”, “back”, “left”, “right”, “vertical”, “horizontal”, “top”, “bottom”, “inside”, “outside”, “clockwise”, “counterclockwise”, “axial”, “radial”, “circumferential”, etc., indicating orientations or positional relationships based on the orientations or positional relationships shown in the accompanying drawings, are only for the convenience of describing the present invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore should not be understood as a limitation to the invention.

[0069] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "illustrative embodiments", "examples", "specific examples", or "some examples" means that the specific features, structures, materials, or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example.

[0070] Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Mentioning "embodiment" in this article means that the specific features, structures or characteristics described in conjunction with the embodiment may be included in at least one embodiment of the present embodiment application. The appearance of this phrase in various positions in the specification is not necessarily the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It can be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.

[0071] Although the embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present invention, and that the scope of the present invention is defined by the claims and their equivalents.

Claims

1. A method for lightweight crop image super-resolution and disease recognition, characterized in that: include: Extract crop disease images from the database as a dataset; Preprocess the data set, build a deep convolutional neural network with enhanced super-resolution generative adversarial network, and train the disease recognition model based on the deep convolutional neural network; Training an image super-resolution model based on the dataset and an enhanced super-resolution generative adversarial network; Distill the image super-resolution model to obtain a lightweight student model; Acquire target crop images and perform image preprocessing; The target crop image is super-resolved according to the lightweight student model, and the disease identification of the target crop is completed based on the disease identification model.

2. The method for lightweight crop image super-resolution and disease identification according to claim 1 is characterized in that: The preprocessing of the data set includes: Degrading the crop disease image to obtain a degraded image, wherein the degradation process includes blurring, scaling, adding noise, and Joint Photographic Experts Group compression; Adding Gaussian noise to the degraded image to simulate random noise interference, outputting pixel values ​​of the image and controlling the pixel values ​​within a first preset range; Changing the brightness of the image, randomly generating a gamma value within a second preset range, and applying the gamma value to the image; Flip the image; Adjust the contrast of the image and set a contrast factor greater than 1 to enhance the contrast of the image to obtain a Class I image.

3. The method for lightweight crop image super-resolution and disease identification according to claim 1, characterized in that: The disease recognition model is trained according to the deep convolutional neural network as follows: The enhanced super-resolution generative adversarial network includes a generator and a discriminator, and model training is performed on the generator and the discriminator respectively; According to the generator, feature extraction is performed on the class I images in the data set to generate a reconstructed image; The reconstructed image and the original image are discriminated according to the discriminator to obtain a discrimination result; The loss function is set according to the discrimination result, and the discriminator and the generator are tuned, wherein the loss function of the generator is: , in, and are all parameters, G is the generator model, is the perceived loss, It is pixel level loss.

4. The method for lightweight crop image super-resolution and disease identification according to claim 1, characterized in that: The image super-resolution model is distilled to obtain a lightweight student model as follows: The trained image super-resolution model is used as the teacher model to build a student model. During the training process, the teacher model generates soft target outputs for the input samples. The loss function of the student model includes reconstruction loss and distillation loss. Use feature distillation loss to measure the difference between the intermediate layer features of the student model and the features of the teacher model and update the student model parameters through the back-propagation algorithm; An optimizer is used to adjust the training parameters of the student model according to the loss function, wherein the training parameters include a learning rate and a loss weight.

5. The method for lightweight crop image super-resolution and disease identification according to claim 1, characterized in that: The obtaining of the target crop image and performing image preprocessing specifically includes: Denoise the image and use non-local mean denoising to reduce image noise while preserving the edges and details of the image; Adjust the brightness of the image by using adaptive histogram equalization; Normalize the image size and resize it using bilinear interpolation.

6. The method for lightweight crop image super-resolution and disease identification according to claim 5, characterized in that: Denoising the image specifically includes: For each pixel in the image, find similar blocks of pixels in the neighborhood; Calculate the average value of all pixel values ​​in the pixel block; The original value of each pixel is replaced by the calculated average value, thereby removing noise and completing a single denoising process; The above denoising process is repeated until a predetermined denoising number is reached or a preset stop condition is met.

7. The method for lightweight crop image super-resolution and disease identification according to claim 2, characterized in that: The flipping of the image includes horizontal flipping or vertical flipping.

8. A lightweight crop image super-resolution and disease recognition system, characterized in that: An extraction module, used to extract crop disease images in the database as a data set; A first preprocessing module, used for preprocessing the data set; Building blocks for constructing deep convolutional neural networks with enhanced super-resolution generative adversarial networks; The first training module is used to train a disease recognition model based on a deep convolutional neural network; A second training module is used to train an image super-resolution model based on the data set and an enhanced super-resolution generative adversarial network; The rectification module is used to distill the image super-resolution model to obtain a lightweight student model; A second preprocessing module is used to obtain target crop images and perform image preprocessing; The image super-resolution module is used to perform image super-resolution on the target crop image according to a lightweight student model, and complete disease recognition of the target crop based on a disease recognition model.

9. A computer device, characterized in that: The method comprises a memory and a processor, wherein the memory stores a computer program, and the processor implements the method for lightweight crop image super-resolution and disease identification as described in any one of claims 1 to 7 when executing the computer program.

10. A computer storage medium, characterized in that: The computer storage medium stores instructions, and when the instructions are executed on a computer, the computer executes the method for lightweight crop image super-resolution and disease identification according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Lightweight image super-resolution reconstruction method based on multi-dimensional knowledge distillation

    CN113240580A

  • Change attention-based variational self-encoding image super-resolution method and system

    CN115984117A

  • Remote sensing image super-resolution reconstruction method based on generative adversarial network

    CN117314751A

  • Knowledge distillation-based light-weight crop disease identification method

    CN118447297A

  • System and method for enhancing text in images based on super-resolution

    US20240193726A1

Cited By

  • Generative adversarial network and Poisson fusion road disease image enhancement method

    CN121304568A

  • Underwater image enhancement method based on improved ARLTGAN model

    CN121563777A

  • Crop image completion and enhancement generation method based on adversarial search

    CN122023860A