A method and system for grading nano-pollution of fruits and vegetables based on convolutional neural network

Through a convolutional neural network-based method, microscopic images of fruit and vegetable epidermis and red light band images are used, combined with deep learning technology, to quickly classify the nano-contamination degree of fruit and vegetable epidermis, solving the problems of high detection cost and low efficiency in the existing technology. Rapid detection of nanocontamination of fruit and vegetable epidermis has been achieved, providing guarantees for the food safety of fruit and vegetable.

CN114792380BActive Publication Date: 2024-11-22SOUTH CHINA AGRICULTURAL UNIVERSITY
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202210374247.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-04-11
Publication Date
2024-11-22
Estimated Expiration
2042-04-11

AI Technical Summary

Technical Problem

The prior art is costly, low efficiency, time-consuming and labor-consuming when detecting nanocontamination of fruit and vegetable epidermis, and cannot effectively ensure the food safety of fruits and vegetables.

Method used

Using a convolutional neural network-based method, the nanopollution level is rapidly graded by using microscopic images and red light band images of fruit and vegetable epidermis, combined with deep learning technology, and the nanopollution of large-scale fruit and vegetable epidermis is achieved by training the convolutional neural network model. Fast detection of degree.

Benefits of technology

It has achieved rapid grading of the nano-contamination degree of fruit and vegetable epidermis, saving manpower, time and testing costs, and providing effective guarantees for the food safety of fruits and vegetables.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114792380B_ABST
    Figure CN114792380B_ABST
Patent Text Reader

Abstract

The present invention discloses a vegetable nano-pollution grading method and system based on a convolutional neural network, and relates to a technology for image classification using a deep learning algorithm, including: obtaining a microscope image of the fruit and vegetable epidermis and a red light band image at the same position thereof, and using the red light band image to classify the microscope image into nano-pollution levels; after the classification, the microscope image is divided into a training picture and a test picture, and the training picture and the test picture are used to train and test an existing convolutional neural network model to obtain a trained pollution grading model; the microscope image of the fruit and vegetable epidermis to be graded is input into the trained pollution grading model to obtain the nano-pollution level of the fruit and vegetable to be graded. The present invention utilizes the microscope image of the fruit and vegetable epidermis that has been graded into nano-pollution levels, combined with deep learning technology, to achieve rapid grading of the nano-pollution degree of the epidermis of a large number of fruits and vegetables, saving manpower, time and detection costs, and providing effective protection for the food safety of fruits and vegetables.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to a technology for image classification using a deep learning algorithm, and more specifically, to a vegetable nano-pollution grading method and system based on a convolutional neural network. Background Art

[0002] Nanoplastic pollution can cause nanoparticles to attach to the cell walls of the fruit and vegetable epidermis, and in severe cases, they can even penetrate the cell walls and enter the plant cells. Currently, there is still no quantitative detection of nanoparticle pollution on the vegetable epidermis. The luminescent particles can be observed using a microscope and fluorescence technology. For example, red fluorescent nanoparticles absorb light in the red light band, and the red pigment produced can be observed using a microscope.

[0003] The prior art discloses a device and method for nondestructive detection of surface pollutants of fruits and vegetables based on tape adhesion. This method uses system detection instead of manual detection, which saves manpower to a certain extent. However, the detection steps are cumbersome, and when faced with large quantities of fruits and vegetables to be tested, it still requires a high time cost and has low efficiency, and cannot provide effective protection for the food safety of fruits and vegetables in a timely manner. Summary of the invention

[0004] In order to overcome the defects of the above-mentioned prior art in detecting nano-contamination of fruit and vegetable skin, such as high cost, low efficiency, time and labor consumption, the present invention provides a vegetable nano-contamination grading method and system based on convolutional neural network, which utilizes the microstructure map of fruit and vegetable skin and combines deep learning technology to realize rapid grading of nano-contamination degree of fruit and vegetable skin in large quantities, thereby providing effective protection for food safety of fruits and vegetables.

[0005] In order to solve the above technical problems, the technical solution of the present invention is as follows:

[0006] The present invention provides a method for grading nano-pollution of fruits and vegetables based on a convolutional neural network, comprising:

[0007] S1: Obtain microscope images of the fruit and vegetable skin and red light band images of the same position;

[0008] S2: classifying the corresponding microscope images of the fruit and vegetable skin into nano-pollution levels according to the red light band images, and obtaining the nano-pollution level corresponding to each microscope image of the fruit and vegetable skin;

[0009] S3: Divide the microscope images of fruit and vegetable skins with nano-contamination levels into training images and test images;

[0010] S4: Input the training images into the existing convolutional neural network model for training to obtain a pollution classification model;

[0011] S5: input the test image into the pollution classification model for testing to obtain a trained pollution classification model;

[0012] S6: Obtain a microscope image of the fruit and vegetable skin to be graded, input it into the trained pollution classification model for detection, and output the nano-pollution level of the fruit and vegetable to be graded.

[0013] Preferably, in step S1, a red light band image of the same position of the fruit and vegetable skin is obtained by using fluorescence technology. The RGB pixel range of the fluorescent agent in the red light band image of the fruit and vegetable skin is R>20.

[0014] Preferably, the step S2 is specifically:

[0015] The microscope image of the fruit and vegetable skin is in the same position as the red light band image, that is, one red light band image corresponds to one microscope image of the fruit and vegetable skin; according to the proportion of red pigment in the total pixels in the red light band image, the microscope image of the fruit and vegetable skin corresponding to the red light band image is divided into no nano pollution, mild nano pollution, moderate nano pollution and severe nano pollution. Specifically, when the proportion of red pigment in the total pixels is 0%, it is no nano pollution; when the proportion of red pigment in the total pixels is 0% to 5%, it is mild nano pollution; when the proportion of red pigment in the total pixels is 5% to 10%, it is moderate nano pollution; when the proportion of red pigment in the total pixels is greater than 10%, it is severe nano pollution.

[0016] Preferably, in step S4, the existing convolutional neural network model is a ResNet50 network model; the ResNet50 network model includes an input unit, a zero-filling unit, a first-stage unit, a second-stage unit, a third-stage unit, a fourth-stage unit, a fifth-stage unit, a classification unit and an output unit connected in sequence.

[0017] The ResNet50 network model includes a feature extraction part and a classification part. The training picture is input through the input unit, and feature extraction is performed through the zero-filling unit, the first-stage unit, the second-stage unit, the third-stage unit, the fourth-stage unit, and the fifth-stage unit, so that the network model learns the deep semantic information of the training picture; the classification unit classifies the extracted deep semantic information of the training picture.

[0018] Preferably, the first stage unit includes a first convolutional layer, a first BN layer, a first activation layer and a maximum pooling layer connected in sequence.

[0019] Preferably, the second-stage unit, the third-stage unit, the fourth-stage unit and the fifth-stage unit are all composed of a convolution block and several identical residual blocks connected in sequence; the second-stage unit includes a convolution block and two identical residual blocks connected in sequence; the third-stage unit includes a convolution block and three identical residual blocks connected in sequence; the fourth-stage unit includes a convolution block and five identical residual blocks connected in sequence; the fifth-stage unit includes a convolution block and two identical residual blocks connected in sequence.

[0020] The input dimension of the convolution block is different from the output dimension, which changes the dimension of the network model and thus changes the width of the extracted features. The input dimension of the identity residual block is the same as the output dimension, which deepens the depth of the network model, making the deep features correspond to a large receptive field, generating high-level semantic information, and extracting richer image features.

[0021] Preferably, the convolution block includes a second convolution layer, a second BN layer, a second activation layer, a third convolution layer, a third BN layer, a third activation layer, a fourth convolution layer, a fourth BN layer, a fifth convolution layer, a fifth BN layer, a first summing point and a fourth activation layer;

[0022] The second convolutional layer, the second BN layer, the second activation layer, the third convolutional layer, the third BN layer, the third activation layer, the fourth convolutional layer, the fourth BN layer, the first summing point and the fourth activation layer are connected in sequence; the fifth convolutional layer and the fifth BN layer are connected in sequence, the input of the fifth convolutional layer is connected to the input of the second convolutional layer, and the output of the fifth BN layer is connected to the first summing point; the input of the second convolutional layer is used as the input of the convolution block, and the output of the fourth activation layer is used as the output of the convolution block.

[0023] The second convolution layer is a 1×1 convolution, which reduces the number of channels of the input features; the third convolution layer is a 3×3 convolution, which performs deep feature extraction on the features after the number of channels is reduced; the fourth convolution layer is a 1×1 convolution, which increases the number of channels for the deep features; the fifth convolution layer changes the dimension of the input features and adds them at the first summation point to fuse the deep features with the shallow features and prevent the gradient from disappearing during the training process; after the addition, the ReLU nonlinear activation function operation is performed to increase the feature information stored in the model.

[0024] Preferably, the identical residual block includes a sixth convolutional layer, a sixth BN layer, a sixth activation layer, a seventh convolutional layer, a seventh BN layer, a seventh activation layer, an eighth convolutional layer, an eighth BN layer, a second summing point and an eighth activation layer;

[0025] The identical residual block includes a sixth convolutional layer, a sixth BN layer, a sixth activation layer, a seventh convolutional layer, a seventh BN layer, a seventh activation layer, an eighth convolutional layer, an eighth BN layer, a second summing point, and an eighth activation layer connected in sequence, and the input of the sixth convolutional layer is connected to the second summing point; the input of the sixth convolutional layer is used as the input of the identical residual block, and the output of the eighth activation layer is used as the output of the identical residual block.

[0026] The sixth convolution layer is a 1×1 convolution, which reduces the number of channels of the input features; the seventh convolution layer is a 3×3 convolution, which performs deep feature extraction on the features after the number of channels is reduced; the eighth convolution layer is a 1×1 convolution, which increases the number of channels for the deep features; the input features are directly connected to the second summing point, without changing the dimension of the input features, but only deepening the depth of the network; at the second summing point, the deep features are fused with the shallow features, and the gradient disappearance during the training process is prevented; after the addition, the ReLU nonlinear activation function operation is performed to increase the feature information stored in the model.

[0027] Preferably, the classification unit includes a global average pooling layer, a flattening layer and a fully connected layer connected in sequence. The function of the global average pooling layer and the flattening layer 1 is to adjust the features to one dimension to fit the input of the fully connected layer for classification; then the one-dimensional features are input into the fully connected layer, and the number of neurons in the fully connected layer is the number of nano pollution levels, which is equivalent to classifying the number of nano pollution levels of the input image, and performing a Softmax operation on the result to obtain the prediction result of the nano pollution level of the image.

[0028] The present invention also provides a fruit and vegetable nano-pollution grading system based on a convolutional neural network, comprising:

[0029] An image acquisition module is used to acquire a microscope image of the fruit and vegetable skin and a red light band image of the same position;

[0030] A level classification module is used to classify the corresponding microscope images of the fruit and vegetable skin into nano-pollution levels according to the red light band images, and obtain the nano-pollution level corresponding to each microscope image of the fruit and vegetable skin;

[0031] An image segmentation module is used to segment microscope images of fruit and vegetable skins with nano-pollution levels into training images and test images;

[0032] The model training module is used to input the training images into the existing convolutional neural network model for training to obtain the pollution classification model;

[0033] The model testing module is used to input the test image into the pollution classification model for testing and obtain the trained pollution classification model;

[0034] The grading detection module is used to obtain microscope images of the fruit and vegetable skin to be graded, input them into the trained pollution grading model for detection, and output the nano-pollution level of the fruit and vegetable to be graded.

[0035] Compared with the prior art, the technical solution of the present invention has the following beneficial effects:

[0036] The present invention first obtains a microscope image of the fruit and vegetable epidermis, and uses a red light band image at the same position to divide the nano pollution level, and determines the nano pollution level of each microscope image of the fruit and vegetable epidermis; then the microscope image of the fruit and vegetable epidermis with the determined nano pollution level is divided into a training picture and a test picture, and the training picture is used to train the existing convolutional neural network model, so that the convolutional neural network model learns the characteristic information of the training picture of each nano pollution level, and forms a pollution classification model; then the test picture is used to test the pollution classification model to obtain a trained pollution classification model; finally, the microscope image of the fruit and vegetable epidermis to be classified is input into the trained pollution classification model for detection, and the nano pollution level of the fruit and vegetable to be classified is obtained. The present invention uses the microscope image of the fruit and vegetable epidermis that has been divided into nano pollution levels, combines the deep learning technology, trains and obtains the pollution classification model, realizes the rapid classification of the nano pollution degree of the epidermis of a large number of fruits and vegetables, saves manpower, time and detection costs, and provides effective protection for the food safety of fruits and vegetables. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] Figure 1 This is a flow chart of a method for grading nano-contamination of fruits and vegetables based on a convolutional neural network as described in Example 1.

[0038] Figure 2 This is a schematic diagram of the structure of the existing convolutional neural network model described in Example 2.

[0039] Figure 3 This is a schematic diagram of the structure of the convolution block described in Example 2.

[0040] Figure 4 This is a schematic diagram of the structure of the identical residual block described in Example 2.

[0041] Figure 5 This is the red light band image of the onion epidermis without nano-pollution described in Example 2.

[0042] Figure 6 This is the red light band image of the onion epidermis with slight nano-contamination as described in Example 2.

[0043] Figure 7 This is the red light band image of the onion epidermis with moderate nano-pollution as described in Example 2.

[0044] Figure 8This is the red light band image of the onion epidermis with severe nano-contamination as described in Example 2.

[0045] Fig. 9 This is a microscope image of the onion epidermis without nano-pollution as described in Example 2.

[0046] Fig.10 This is a microscope image of the onion epidermis with mild nano-contamination as described in Example 2.

[0047] Fig.11 This is a microscope image of the onion epidermis with moderate nano-contamination as described in Example 2.

[0048] Fig.12 This is a microscope image of the onion epidermis with severe nano-contamination as described in Example 2.

[0049] Fig.13 This is a schematic diagram of the structure of a fruit and vegetable nano-pollution grading system based on a convolutional neural network as described in Example 3. DETAILED DESCRIPTION

[0050] The drawings are for illustrative purposes only and should not be construed as limiting the present patent;

[0051] In order to better illustrate the present embodiment, some parts in the drawings may be omitted, enlarged or reduced, and do not represent the size of the actual product;

[0052] It is understandable to those skilled in the art that some well-known structures and their descriptions may be omitted in the drawings.

[0053] The technical solution of the present invention is further described below in conjunction with the accompanying drawings and embodiments.

[0054] Example 1

[0055] This embodiment provides a method for grading nano-contamination of fruits and vegetables based on a convolutional neural network. Figure 1 As shown, including:

[0056] S1: Obtain microscope images of the fruit and vegetable skin and red light band images of the same position;

[0057] S2: classifying the corresponding microscope images of the fruit and vegetable skin into nano-pollution levels according to the red light band images, and obtaining the nano-pollution level corresponding to each microscope image of the fruit and vegetable skin;

[0058] S3: Divide the microscope images of fruit and vegetable skins with nano-contamination levels into training images and test images;

[0059] S4: Input the training images into the existing convolutional neural network model for training to obtain a pollution classification model;

[0060] S5: input the test image into the pollution classification model for testing to obtain a trained pollution classification model;

[0061] S6: Obtain a microscope image of the fruit and vegetable skin to be graded, input it into the trained pollution classification model for detection, and output the nano-pollution level of the fruit and vegetable to be graded.

[0062] In the specific implementation process, this embodiment first obtains the microscope image of the fruit and vegetable epidermis, and uses the red light band image at the same position to divide the nano pollution level, and determines the nano pollution level of each microscope image of the fruit and vegetable epidermis; then the microscope image of the fruit and vegetable epidermis with the determined nano pollution level is divided into a training picture and a test picture, and the training picture is used to train the existing convolutional neural network model, so that the convolutional neural network model learns the characteristic information of the training picture of each nano pollution level, and forms a pollution classification model; then the pollution classification model is tested with the test picture to obtain a trained pollution classification model; finally, the microscope image of the fruit and vegetable epidermis to be classified is input into the trained pollution classification model for detection, and the nano pollution level of the fruit and vegetable to be classified is obtained. The present invention uses the microscope image of the fruit and vegetable epidermis that has been divided into nano pollution levels, combined with deep learning technology, to train and obtain a pollution classification model; it can realize the rapid classification of the nano pollution degree of the epidermis of a large number of fruits and vegetables, save manpower, time and detection costs, and provide effective protection for the food safety of fruits and vegetables.

[0063] Example 2

[0064] This embodiment provides a method for grading nano-contamination of fruits and vegetables based on a convolutional neural network, comprising:

[0065] S1: Obtain microscope images of the fruit and vegetable skin and red light band images of the same position;

[0066] S2: Classify the corresponding microscope images of the fruit and vegetable skin into nano-pollution levels according to the red light band images, and obtain the nano-pollution level corresponding to each microscope image of the fruit and vegetable skin; specifically:

[0067] Fluorescence technology is used to obtain red light band images at the same position on the fruit and vegetable skin. The microscope image of the fruit and vegetable skin is at the same position as the red light band image, that is, one red light band image corresponds to one microscope image of the fruit and vegetable skin; according to the proportion of red pigments in the total pixels in the red light band image, the microscope image of the fruit and vegetable skin corresponding to the red light band image is divided into no nano-pollution, mild nano-pollution, moderate nano-pollution and severe nano-pollution.

[0068] S3: Divide the microscope images of fruit and vegetable skins with nano-contamination levels into training images and test images;

[0069] S4: Input the training images into the existing convolutional neural network model for training to obtain a pollution classification model;

[0070] like Figure 2 As shown, the existing convolutional neural network model is a ResNet50 network model, which includes an input unit, a zero-filling unit, a first-stage unit, a second-stage unit, a third-stage unit, a fourth-stage unit, a fifth-stage unit, a classification unit, and an output unit that are connected in sequence.

[0071] The ResNet50 network model includes a feature extraction part and a classification part. The training picture is input through the input unit, and the feature extraction is performed through the zero-filling unit, the first-stage unit, the second-stage unit, the third-stage unit, the fourth-stage unit, and the fifth-stage unit, so that the network model learns the deep semantic information of the training picture; the classification unit classifies the extracted deep semantic information of the training picture;

[0072] The first stage unit includes a first convolutional layer, a first BN layer, a first activation layer and a maximum pooling layer connected in sequence; the second stage unit, the third stage unit, the fourth stage unit and the fifth stage unit are each composed of a convolutional block and a number of identical residual blocks connected in sequence; the second stage unit includes a convolutional block and two identical residual blocks connected in sequence; the third stage unit includes a convolutional block and three identical residual blocks connected in sequence; the fourth stage unit includes a convolutional block and five identical residual blocks connected in sequence; the second stage unit includes a convolutional block and two identical residual blocks connected in sequence; the classification unit includes a global average pooling layer, a flattening layer and a fully connected layer connected in sequence;

[0073] like Figure 3As shown, the convolution block includes a second convolution layer, a second BN layer, a second activation layer, a third convolution layer, a third BN layer, a third activation layer, a fourth convolution layer, a fourth BN layer, a fifth convolution layer, a fifth BN layer, a first summing point and a fourth activation layer; the second convolution layer, the second BN layer, the second activation layer, the third convolution layer, the third BN layer, the third activation layer, the fourth convolution layer, the fourth BN layer, the first summing point and the fourth activation layer are connected in sequence; the fifth convolution layer and the fifth BN layer are connected in sequence, the input of the fifth convolution layer is connected to the input of the second convolution layer, and the output of the fifth BN layer is connected to the first summing point; the input of the second convolution layer is used as the input of the convolution block, and the output of the fourth activation layer is used as the convolution The output of the block; the input dimension of the convolution block is different from the output dimension, which changes the dimension of the network model and thus changes the width of the extracted features; the second convolution layer is a 1×1 convolution, which reduces the number of channels of the input features; the third convolution layer is a 3×3 convolution, which performs deep feature extraction on the features after the number of channels is reduced; the fourth convolution layer is a 1×1 convolution, which increases the number of channels for the deep features; the fifth convolution layer changes the dimension of the input features and adds them at the first summation point to fuse the deep features with the shallow features and prevent the gradient from disappearing during the training process; after the addition, the ReLU nonlinear activation function operation is performed to increase the feature information stored in the model.

[0074] like Figure 4 As shown, the identical residual block includes a sixth convolutional layer, a sixth BN layer, a sixth activation layer, a seventh convolutional layer, a seventh BN layer, a seventh activation layer, an eighth convolutional layer, an eighth BN layer, a second summing point and an eighth activation layer;

[0075] The identical residual block includes a sixth convolutional layer, a sixth BN layer, a sixth activation layer, a seventh convolutional layer, a seventh BN layer, a seventh activation layer, an eighth convolutional layer, an eighth BN layer, a second summing point, and an eighth activation layer connected in sequence, and the input of the sixth convolutional layer is connected to the second summing point; the input of the sixth convolutional layer is used as the input of the identical residual block, and the output of the eighth activation layer is used as the output of the identical residual block.

[0076] The sixth convolutional layer is a 1×1 convolution, which reduces the number of channels of the input features; the seventh convolutional layer is a 3×3 convolution, which extracts deep features from the features after the number of channels is reduced; the eighth convolutional layer is a 1×1 convolution, which increases the number of channels for deep features; the input features are directly connected to the second summing point, without changing the dimension of the input features, only deepening the depth of the network; at the second summing point, the deep features are fused with the shallow features, and the gradient disappearance during the training process is prevented; after addition, the ReLU nonlinear activation function operation is performed to increase the feature information stored in the model. The input dimension and output dimension of the identity residual block are the same, which deepens the depth of the network model, so that the deep features correspond to a large receptive field, generate high-level semantic information, and extract richer image features.

[0077] The function of the global average pooling layer and the flattening layer 1 is to adjust the features to one dimension to suit the input of the fully connected layer for classification. The one-dimensional features are then input into the fully connected layer. The number of neurons in the fully connected layer is the number of nano-pollution levels, which is equivalent to classifying the number of nano-pollution levels of the input image. The result is subjected to a Softmax operation to obtain the prediction result of the nano-pollution level of the image.

[0078] S5: Input the test image into the pollution classification model for testing to obtain a trained pollution classification model; S6: Obtain a microscope image of the fruit and vegetable skin to be classified, input it into the trained pollution classification model for detection, and output the nano-pollution level of the fruit and vegetable to be classified.

[0079] In the specific implementation process, the method of this embodiment is explained by taking onion as an example. The microscopic structure of the onion epidermis is obtained through a microscope, and the red light band image corresponding to the onion epidermis microscope image is obtained by using fluorescence technology, such as Figure 5-Figure 8 As shown in the figure, there are red light band images of onion epidermis with no nano-pollution, slight nano-pollution, moderate nano-pollution and severe nano-pollution, respectively; the proportion of red pigment in the total pixels in the red light band image is used to divide the nano-pollution level of onion epidermis microscope images into no nano-pollution (accounting for 0%), slight nano-pollution (accounting for 0% to 5%), moderate nano-pollution (accounting for 5% to 10%) and severe nano-pollution (accounting for more than 10%). 500 onion epidermis microscope images of each pollution level are formed to form a data set; as shown in the figure, there are red light band images of onion epidermis with no nano-pollution (accounting for 0%), slight nano-pollution (accounting for 0% to 5%), moderate nano-pollution (accounting for 5% to 10%) and severe nano-pollution (accounting for more than 10%). Figure 9-12 The following are microscope images of onion epidermis with no nano-pollution, slight nano-pollution, moderate nano-pollution, and severe nano-pollution, respectively. After the level division is completed, the images in the data set are randomly divided into training images and test images, with a division ratio of 7:3;

[0080] The training image is input into ResNet50, and the first stage unit performs convolution, standardization, and activation function operations; the training image size is 224×224×3, the first convolution layer is a 7×7 convolution, the step size is 2, and the number of channels is 64. After convolution, the height and width of the training image will be compressed, the number of channels becomes 64, and the feature layer size of 112×112×64 is obtained. After the feature layer is standardized and the activation function is operated, the maximum pooling operation is performed to reduce the information redundancy of the feature layer. The step size of the pooling layer is 2, and the feature layer size output by the first stage unit is 56×56×64.

[0081] The second stage unit includes a convolution block and two equal residual blocks. The stride of the convolution block is 1, so the dimension of the feature layer will not change. The size of the output feature layer is 56×56×256, and the number of output channels is expanded by 4 times. The third stage unit includes a convolution block and three equal residual blocks. The stride of the convolution block is 2, so the height and width of the input feature layer will be compressed. The size of the output feature layer is 28×28×512, and the number of output channels is expanded by 2 times. The fourth stage unit includes a convolution block and five equal residual blocks. The stride of the convolution block is 2, so the height and width of the input feature layer will be compressed. The size of the output feature layer is 14×14×1024, and the number of output channels is expanded by 2 times. The fifth stage unit includes a convolution block and two equal residual blocks connected in sequence. The stride of the convolution block is 2, so the height and width of the input feature layer will be compressed. The size of the output feature layer is 7×7×2048, and the number of output channels is expanded by 2 times. At this point, the feature extraction part is completed. Finally, the 7×7×2048 feature layer is input into the global average pooling layer and the flattening layer, adjusted to one dimension, and a 2048 vector is obtained. The vector is input into the fully connected layer. The number of neurons in the fully connected layer is the number of nano-pollution levels. The result is subjected to Softmax operation to obtain the prediction result of the nano-pollution level of the image.

[0082] Example 3

[0083] This embodiment provides a fruit and vegetable nano-pollution grading system based on a convolutional neural network, which is used to implement the method described in Embodiment 1 or 2, such as Fig.13 As shown, including:

[0084] An image acquisition module is used to acquire a microscope image of the fruit and vegetable skin and a red light band image of the same position;

[0085] A level classification module is used to classify the corresponding microscope images of the fruit and vegetable skin into nano-pollution levels according to the red light band images, and obtain the nano-pollution level corresponding to each microscope image of the fruit and vegetable skin;

[0086] An image segmentation module is used to segment microscope images of fruit and vegetable skins with nano-pollution levels into training images and test images;

[0087] The model training module is used to input the training images into the existing convolutional neural network model for training to obtain the pollution classification model;

[0088] The model testing module is used to input the test image into the pollution classification model for testing and obtain the trained pollution classification model;

[0089] The grading detection module is used to obtain microscope images of the fruit and vegetable skin to be graded, input them into the trained pollution grading model for detection, and output the nano-pollution level of the fruit and vegetable to be graded.

[0090] The same or similar reference numerals correspond to the same or similar components;

[0091] The terms used in the drawings to describe positional relationships are only used for illustrative purposes and should not be construed as limiting this patent;

[0092] Obviously, the above embodiments of the present invention are merely examples for clearly illustrating the present invention, and are not intended to limit the embodiments of the present invention. For those skilled in the art, other different forms of changes or modifications can be made based on the above description. It is not necessary and impossible to list all the embodiments here. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the protection scope of the claims of the present invention.

Claims

1. A method for grading nano-pollution of fruits and vegetables based on convolutional neural networks, characterized in that: include: S1: Obtaining a microscope image of the fruit and vegetable epidermis and a red light band image of the same position thereof; wherein the red light band image of the same position of the fruit and vegetable epidermis is obtained by using fluorescence technology; S2: Classify the corresponding microscope images of the fruit and vegetable skin into nano-pollution levels according to the red light band images, and obtain the nano-pollution level corresponding to each microscope image of the fruit and vegetable skin, specifically: The microscope image of the fruit and vegetable epidermis is in the same position as the red light band image, that is, one red light band image corresponds to one microscope image of the fruit and vegetable epidermis; according to the proportion of red pigment in the total pixels in the red light band image, the microscope image of the fruit and vegetable epidermis corresponding to the red light band image is divided into no nano-pollution, light nano-pollution, moderate nano-pollution and heavy nano-pollution; when the proportion of red pigment in the total pixels is 0%, it is no nano-pollution; when the proportion of red pigment in the total pixels is 0% to 5%, it is light nano-pollution; when the proportion of red pigment in the total pixels is 5% to 10%, it is moderate nano-pollution; when the proportion of red pigment in the total pixels is greater than 10%, it is heavy nano-pollution; S3: Divide the microscope images of fruit and vegetable skins with nano-contamination levels into training images and test images; S4: Input the training images into the existing convolutional neural network model for training to obtain a pollution classification model; S5: input the test image into the pollution classification model for testing to obtain a trained pollution classification model; S6: Obtain a microscope image of the fruit and vegetable skin to be graded, input it into the trained pollution classification model for detection, and output the nano-pollution level of the fruit and vegetable to be graded.

2. The method for grading nano-pollution of fruits and vegetables based on convolutional neural network according to claim 1, characterized in that: In step S4, the existing convolutional neural network model is a ResNet50 network model, including an input unit, a zero-filling unit, a first-stage unit, a second-stage unit, a third-stage unit, a fourth-stage unit, a fifth-stage unit, a classification unit, and an output unit connected in sequence.

3. The method for grading nano-pollution of fruits and vegetables based on convolutional neural network according to claim 2, characterized in that: The first stage unit includes the first convolutional layer, the first BN layer, the first activation layer and the maximum pooling layer connected in sequence.

4. The method for grading nano-pollution of fruits and vegetables based on convolutional neural network according to claim 2, characterized in that: The second-stage unit, the third-stage unit, the fourth-stage unit and the fifth-stage unit are all composed of a convolution block and several identical residual blocks connected in sequence; the second-stage unit includes a convolution block and two identical residual blocks connected in sequence; the third-stage unit includes a convolution block and three identical residual blocks connected in sequence; the fourth-stage unit includes a convolution block and five identical residual blocks connected in sequence; the fifth-stage unit includes a convolution block and two identical residual blocks connected in sequence.

5. The method for grading nano-pollution of fruits and vegetables based on convolutional neural network according to claim 4, characterized in that: The convolution block includes a second convolution layer, a second BN layer, a second activation layer, a third convolution layer, a third BN layer, a third activation layer, a fourth convolution layer, a fourth BN layer, a fifth convolution layer, a fifth BN layer, a first summing point and a fourth activation layer; The second convolutional layer, the second BN layer, the second activation layer, the third convolutional layer, the third BN layer, the third activation layer, the fourth convolutional layer, the fourth BN layer, the first summing point and the fourth activation layer are connected in sequence; the fifth convolutional layer and the fifth BN layer are connected in sequence, the input of the fifth convolutional layer is connected to the input of the second convolutional layer, and the output of the fifth BN layer is connected to the first summing point; the input of the second convolutional layer is used as the input of the convolution block, and the output of the fourth activation layer is used as the output of the convolution block.

6. The method for grading nano-pollution of fruits and vegetables based on convolutional neural network according to claim 4, characterized in that: The identical residual block includes a sixth convolutional layer, a sixth BN layer, a sixth activation layer, a seventh convolutional layer, a seventh BN layer, a seventh activation layer, an eighth convolutional layer, an eighth BN layer, a second summing point and an eighth activation layer; The identical residual block includes a sixth convolutional layer, a sixth BN layer, a sixth activation layer, a seventh convolutional layer, a seventh BN layer, a seventh activation layer, an eighth convolutional layer, an eighth BN layer, a second summing point, and an eighth activation layer connected in sequence, and the input of the sixth convolutional layer is connected to the second summing point; the input of the sixth convolutional layer is used as the input of the identical residual block, and the output of the eighth activation layer is used as the output of the identical residual block.

7. The method for grading nano-pollution of fruits and vegetables based on convolutional neural network according to claim 2, characterized in that: The classification unit includes a global average pooling layer, a flattening layer and a fully connected layer connected in sequence.

8. A fruit and vegetable nano-pollution grading system based on convolutional neural network, characterized in that: include: An image acquisition module is used to acquire a microscope image of the fruit and vegetable skin and a red light band image of the same position thereof; wherein the red light band image of the same position of the fruit and vegetable skin is acquired by using fluorescence technology; The level classification module is used to classify the nano-pollution level of the corresponding microscope images of the fruit and vegetable skin according to the red light band image, and obtain the nano-pollution level corresponding to each microscope image of the fruit and vegetable skin, specifically: The microscope image of the fruit and vegetable epidermis is in the same position as the red light band image, that is, one red light band image corresponds to one microscope image of the fruit and vegetable epidermis; according to the proportion of red pigment in the total pixels in the red light band image, the microscope image of the fruit and vegetable epidermis corresponding to the red light band image is divided into no nano-pollution, light nano-pollution, moderate nano-pollution and heavy nano-pollution; when the proportion of red pigment in the total pixels is 0%, it is no nano-pollution; when the proportion of red pigment in the total pixels is 0% to 5%, it is light nano-pollution; when the proportion of red pigment in the total pixels is 5% to 10%, it is moderate nano-pollution; when the proportion of red pigment in the total pixels is greater than 10%, it is heavy nano-pollution; An image segmentation module is used to segment microscope images of fruit and vegetable skins with nano-pollution levels into training images and test images; The model training module is used to input the training images into the existing convolutional neural network model for training to obtain the pollution classification model; The model testing module is used to input the test image into the pollution classification model for testing and obtain the trained pollution classification model; The grading detection module is used to obtain microscope images of the fruit and vegetable skin to be graded, input them into the trained pollution grading model for detection, and output the nano-pollution level of the fruit and vegetable to be graded.

Citation Information

Patent Citations

  • Automatic automobile exhaust monitoring system based on image and FPGA (Field Programmable Gate Array)

    CN102042986A

  • Air pollution degree classification method based on image end-to-end

    CN108985353A

  • Method and apparatus for determining the contamination state of a surface of a faceted element

    DE102020206753A1