CN113192026A - Walnut maturity detection and prediction method based on visible light image - Google Patents

Walnut maturity detection and prediction method based on visible light image Download PDF

Info

Publication number
CN113192026A
CN113192026A CN202110468741.2A CN202110468741A CN113192026A CN 113192026 A CN113192026 A CN 113192026A CN 202110468741 A CN202110468741 A CN 202110468741A CN 113192026 A CN113192026 A CN 113192026A
Authority
CN
China
Prior art keywords
walnut
maturity
network
image
walnuts
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202110468741.2A
Other languages
Chinese (zh)
Other versions
CN113192026B (en
Inventor
陈锋军
崔凯旋
朱学岩
曹跃腾
于越
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Forestry University
Original Assignee
Beijing Forestry University
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Forestry University filed Critical Beijing Forestry University
Priority to CN202110468741.2A priority Critical patent/CN113192026B/en
Publication of CN113192026A publication Critical patent/CN113192026A/en
Application granted granted Critical
Publication of CN113192026B publication Critical patent/CN113192026B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/0002Inspection of images, e.g. flaw detection
    • G06T7/0004Industrial image inspection
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/044Recurrent networks, e.g. Hopfield networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/045Combinations of networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/047Probabilistic or stochastic networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/40Image enhancement or restoration using histogram techniques
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/90Dynamic range modification of images or parts thereof
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/90Determination of colour characteristics
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/10Image acquisition modality
    • G06T2207/10024Color image
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20081Training; Learning
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20084Artificial neural networks [ANN]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20112Image segmentation details
    • G06T2207/20132Image cropping
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20212Image combination
    • G06T2207/20221Image fusion; Image merging
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/30Subject of image; Context of image processing
    • G06T2207/30108Industrial image inspection
    • G06T2207/30128Food products
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/30Subject of image; Context of image processing
    • G06T2207/30181Earth observation
    • G06T2207/30188Vegetation; Agriculture
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/30Subject of image; Context of image processing
    • G06T2207/30204Marker

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Molecular Biology (AREA)
  • Evolutionary Computation (AREA)
  • Health & Medical Sciences (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Biomedical Technology (AREA)
  • Biophysics (AREA)
  • Computational Linguistics (AREA)
  • Data Mining & Analysis (AREA)
  • Software Systems (AREA)
  • General Health & Medical Sciences (AREA)
  • Mathematical Physics (AREA)
  • Computing Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Quality & Reliability (AREA)
  • Probability & Statistics with Applications (AREA)
  • Image Analysis (AREA)

Abstract

The invention discloses a walnut maturity detection and prediction method based on a visible light image, belonging to the field of deep learning and image processing: firstly, walnut samples and color images of the walnut samples at different periods are collected, the fat content of the samples is measured, the walnut maturity grades are divided according to the fat content and external characteristics of the walnut kernels at different periods, and a walnut maturity detection and prediction data set is established. And then screening low-illumination walnut images and preprocessing the low-illumination walnut images, inputting the images into an improved FasterRCNN network, outputting the maturity of the walnuts in the images by the network, marking the maturity by a suggestion box, and simultaneously evaluating the fat content in the walnut kernels under the maturity. And finally, intercepting a walnut area from an original image according to the walnut suggestion frame, inputting the walnut area into an LSTM-based walnut maturity prediction algorithm, and predicting the walnut maturity and fat content three days later. The method can accurately detect the current maturity and the three-day later maturity of the walnut in the image and evaluate the fat content of the walnut.

Description

Walnut maturity detection and prediction method based on visible light image
Technical Field
The invention belongs to the field of deep learning and image processing, and particularly relates to a walnut maturity detection and prediction method based on a visible light image.
Background
The oil yield of the walnut kernels is closely related to the maturity of the walnut kernels, the walnut kernels picked earlier are not completely ripe, the oil yield is low, and the conversion of various nutrient substances is not completed; walnut picked later is easy to mildew and deteriorate, and the quality of walnut oil is further influenced. Therefore, how to judge the maturity of the walnuts in the current period and predict the maturity of the walnuts is beneficial to guiding harvesting, improving the oil production quality and quality of the walnut kernels and improving the economic benefits of the walnut planting industry and oil extraction enterprises.
According to the current knowledge, methods for detecting and predicting the maturity of the walnut are not found, but methods for detecting or predicting the maturity of other crops or fruits are not enough to be applied to tasks of detecting and predicting the maturity of the walnut:
the invention discloses a Chinese patent with the patent application number of 202010400749.0, and the name of the Chinese patent is 'prediction method for the flowering beginning and seed picking period of oil peony'. According to the invention, in the peony maturation period prediction processes [0026], [0029], [0033] and [0036], meteorological factors used by an oil peony model need to be measured on site and for multiple times, and the meteorological factor data is substituted into the prediction model to obtain the oil peony flowering period and the oil peony seed recovery period. However, this approach has several disadvantages: firstly, the method needs to repeatedly measure a plurality of meteorological factor data, and is tedious and time-consuming; secondly, the method needs to use different instruments to measure data such as ground temperature, air temperature, humidity, sunshine duration, precipitation and the like, and the accuracy of each data is easily interfered by factors such as instrument accuracy, environment complexity, measurement normalization and the like, so that the measurement result is not favorable for the accuracy of the final prediction result.
The patent application number is 201911026968.0, and the invention discloses a Chinese patent named as a nondestructive testing method for blueberry maturity based on a deep convolutional neural network. In the blueberry maturity nondestructive testing process [0030], [0033] and [0034], a chlorophyll content prediction data set BCPD is divided according to the chlorophyll content in the blueberry, and the blueberry chlorophyll prediction content network BCPN is trained, and the trained convolutional neural network can be used for blueberry maturity prediction, however, the method has the following defects for reference of walnut maturity detection: firstly, measuring a chlorophyll value of each period, labeling an Image of the corresponding period by using a Label-Image script, constructing a chlorophyll content prediction data set BCPD, and using the data set for training and testing a blueberry chlorophyll prediction content network BCPN, wherein the method is based on the change of chlorophyll, which is expressed as the change of the color of blueberries on a color Image, but the change of the appearance color of walnuts in the mature period is very weak, so that the method provided by the invention is not suitable for detecting the maturity of walnuts; secondly, the method is mainly used for judging the maturity of the blueberries in the image, but the content of main nutrients under the maturity is not predicted, but the maturity detection of the walnuts not only needs to detect the maturity of each walnut in the image, but also needs to analyze the content of the main nutrients in the walnut kernels under the maturity; thirdly, the method mainly predicts the maturity of the blueberries in the color image input into the prediction model, and if the blueberries are not mature yet, the future maturity of the blueberries cannot be predicted.
Disclosure of Invention
The invention provides a visible light image-based walnut maturity detection and prediction method, which can detect the maturity of each walnut in an image by using a visible light image of a hanging walnut under natural conditions, evaluate the fat content in walnut kernels, and predict the maturity and the fat content of the walnut kernels after three days aiming at the walnut kernels of which the maturity does not meet the optimal oil extraction requirement.
According to the calculation process of the invention, the method for detecting and predicting the walnut maturity based on the visible light image comprises the following steps:
firstly, grading the maturity of walnuts: taking 'Liaoning No. 1' walnut as an experimental variety, randomly selecting 50 healthy walnuts with no disease and relatively consistent maturity from the fruit development of 103d every 3 days for picking, carrying out image acquisition on the walnuts before picking, carrying out fat content detection on walnut samples in batches in a picking time period, researching a mapping relation between the internal quality and the appearance representation of the walnuts by combining images acquired at corresponding time, dividing the walnut maturity grade, and recording the fat content in each maturity walnut kernel;
secondly, establishing a walnut maturity detection data set: marking the shot image by using a LabLeImg image marking tool according to the divided walnut maturity levels, and establishing a walnut maturity detection data set in a Pascal VOC format;
thirdly, establishing a walnut maturity prediction data set: in a walnut plantation, from fruit development 103d, randomly selecting 20 healthy experimental trees, selecting 10 healthy and disease-free walnuts with relatively consistent maturity from each experimental tree for protection and marking, fixing shooting distance and angle, shooting 200 walnuts every day, cutting out an image containing only one walnut by using an image cutting tool, and recording the name, shooting date and maturity of the cut picture in an xlsx format table;
fourthly, constructing a walnut maturity detection network based on improved fast RCNN: firstly screening low-illumination walnut images, preprocessing the low-illumination walnut images by using histogram equalization, brightness adjustment and contrast adjustment to highlight color characteristics and texture characteristics of walnuts in the low-illumination images, then adjusting the length and width of the images to 1024 x 1024 and inputting the images into an improved Faster RCNN network, extracting walnut characteristics by using a ResNet101 network by using the improved Faster RCNN network to obtain a characteristic diagram, then taking out the characteristic diagram which is obtained by compressing the size of the input images by two times, three times, four times and five times, inputting the characteristic diagram into a BiFPN network for further characteristic extraction and characteristic fusion, taking out the characteristic diagram which is obtained by compressing the size of the BiFPN network by five times, transmitting the characteristic diagram to a regional suggestion network, in order to solve the condition that adjacent walnuts are missed to be detected, performing non-maximum value inhibition by using a Soft-NMS algorithm by the regional suggestion network to obtain candidate frames, inputting the candidate regions into a region-of-interest pooling network, outputting maturity results by a classifier, meanwhile, generating an accurate position of the suggestion frame, and obtaining the fat content of the walnut kernels under the maturity by inquiring the record of the first step, wherein in order to improve the detection precision of the walnut maturity, a SENET attention mechanism is added into a classification network of a pooling network of an interested area, so that the position detection and the maturity detection of the walnut kernels are more accurate;
fifthly, constructing a walnut maturity prediction network based on the LSTM: intercepting the walnut region in the original image by using the suggested frame position provided by the fourth step, compressing the length multiplied by the width multiplied by the channel of the image of the intercepted region to 112 multiplied by 112, inputting the image into an LSTM network for maturity prediction and fat content prediction after three days after the image is extracted by ResNet18 features;
sixthly, algorithm training: training the algorithms constructed in the fourth step and the fifth step, firstly freezing a walnut maturity prediction network based on LSTM, performing parameter training of the walnut maturity detection network based on improved fast RCNN by using a walnut maturity detection data set, setting Epoch to be 200, continuously converging and stabilizing loss values by adopting an Adam optimizer, and then selecting the training weight with the minimum verification set loss value as the weight of the walnut maturity detection network based on improved fast RCNN; then freezing a walnut maturity detection network based on improved Faster RCNN, unfreezing a walnut maturity prediction network based on LSTM, training the walnut maturity prediction network based on LSTM by using a walnut maturity prediction data set, setting Epoch as 500, and continuously converging and stabilizing the loss value by adopting an Adam optimizer, selecting the training weight with the minimum loss value of the verification set as the weight of the walnut maturity prediction algorithm based on the LSTM, finally carrying out all unfreezing training on the walnut maturity detection network based on the improved fast RCNN and the walnut maturity prediction network based on the LSTM, training a walnut maturity detection and prediction method based on a visible light image, setting Epoch as 100, setting a learning rate as 0.001, using a walnut maturity detection data set, carrying out network optimization on a network by adopting an Adam algorithm to make a total loss value converge, and selecting a weight with the minimum loss value as a weight of the walnut maturity detection and prediction method based on the visible light image;
seventhly, executing an algorithm: inputting a test image into a walnut maturity detection and prediction method based on a visible light image, outputting the maturity of each walnut in the image, evaluating the fat content of the current walnut according to the corresponding relation between the maturity and the fat content, predicting the maturity of the walnut after three days according to the characteristics of the walnut in the image and evaluating the fat content of the walnut at the moment when the maturity does not meet the oil extraction requirement;
according to the seven steps, the method for detecting and predicting the walnut maturity based on the visible light image is characterized in that the walnut maturity grade division in the first step is as follows: picking walnut samples and collecting images once every 3 days from the fruit development of 103d, randomly selecting 50 healthy walnuts without diseases and with relatively consistent maturity for picking each time, and the walnut image is shot before picking, the picked walnut sample and the image are marked to realize one-to-one correspondence, taking out walnut kernels of 50 walnuts picked in each time period, detecting the fat content by adopting an acid hydrolysis method according to the determination of fat in GB 5009.6-2016 national food safety standard, according to the change rule of fat content in walnuts picked at different time, and the color characteristic, the texture characteristic and the cracking degree of the walnuts at corresponding time, the mapping relation of the internal quality and the appearance representation of the walnuts is explored, further dividing the maturity grade of the walnut, and recording the fat content in the walnut kernels with different maturity grades;
according to the seven steps, the method for detecting and predicting the walnut maturity based on the visible light images is characterized in that the fourth step is based on low-illumination walnut image screening and image preprocessing in the construction of a walnut maturity detection network of improved fast RCNN, a brightness screening threshold value is set to 54 so as to screen out low-illumination images, histogram equalization, brightness adjustment and contrast adjustment are carried out on the images with the image brightness lower than the threshold value 54, and the color characteristics and the texture characteristics of walnuts in the images are enhanced;
according to the seven steps, the walnut maturity detection and prediction method based on the visible light image is characterized in that the fourth step is based on a walnut maturity detection network of improved fast RCNN, the improved fast RCNN algorithm uses a ResNet101 network to extract walnut features to obtain a feature map, a BiFPN network is used for further feature extraction and feature fusion, a Soft-NMS algorithm is used for replacing a traditional NMS algorithm to carry out non-maximum value inhibition to reduce the omission ratio of adjacent walnuts, and a SENET attention mechanism is added to a classification network of region-of-interest pooling, so that the attention degree of the network to certain channel information in the feature map is autonomously improved, and the detection precision is improved;
according to the seven steps, the walnut maturity detection and prediction method based on the visible light image is characterized in that the fifth step is based on the walnut maturity prediction network of the LSTM, the walnut position detected by the improved Faster RCNN algorithm is cut out from an original image, the length multiplied by the width multiplied by the channel is compressed to 112 multiplied by 3, the ResNet18 feature extraction network is input to obtain the 7 multiplied by 512 feature map, the feature map channel is compressed to 256, and the walnut maturity prediction network based on the LSTM network is input;
according to the seven steps, the method for detecting and predicting the walnut maturity based on the visible light image is characterized in that algorithm training in the sixth step is performed, and two different data sets are adopted to perform a step-by-step combined training method on different parts of the same algorithm so as to complete the task of detecting and predicting the walnut maturity.
The invention has the beneficial effects that: the method comprises the steps of picking walnuts in different periods, collecting corresponding walnut pictures, summarizing change rules of fat content in the walnuts in different periods through detection of fat content in the walnuts, dividing a walnut maturity standard with the aim of improving oil extraction rate of the walnuts in the corresponding period combined with external phenotype characteristics of the walnuts in the corresponding period, constructing a walnut maturity detection data set and a walnut maturity prediction data set according to the standard, and training a visible light image-based walnut maturity detection and prediction method to realize detection and prediction of the walnut maturity by adopting a step-by-step combination training mode. The invention can effectively detect walnuts with different maturity, predict the maturity after three days for the walnuts with the maturity which does not meet the optimal oil extraction requirement, and simultaneously evaluate the fat content in the walnut kernels with the maturity at the same time.
Specific embodiments of the present invention are disclosed in detail with reference to the following description and drawings, indicating the manner in which the principles of the invention may be employed. It should be understood that the embodiments of the invention are not so limited in scope. The embodiments of the invention include many variations, modifications and equivalents within the terms of the appended claims.
Drawings
FIG. 1 is a design flow chart of the present invention
FIG. 2 is a flow chart of fat content detection in walnut kernel
FIG. 3 is a schematic diagram of walnut maturity xlsx format recording mode
FIG. 4 is a diagram of the algorithm structure proposed by the present invention
FIG. 5 is a diagram of SE _ ResNet structure
Detailed Description
The foregoing and other features of the invention will become apparent from the following specification taken in conjunction with the accompanying drawings. In the description and drawings, particular embodiments of the invention have been disclosed in detail as being indicative of some of the embodiments in which the principles of the invention may be employed, it being understood that the invention is not limited to the embodiments described, but, on the contrary, is intended to cover all modifications, variations, and equivalents falling within the scope of the appended claims.
The embodiment of the invention provides a walnut maturity detection and prediction method based on a visible light image. Fig. 1 is a schematic flow chart of a method for detecting and predicting the maturity of a walnut based on a visible light image according to an embodiment of the present invention, where the method for detecting and predicting the maturity of a walnut based on a visible light image includes:
step 101, starting from the fruit development 103d of the walnut of 'Liaoning No. 1', picking walnut samples and collecting images once every 3 days, selecting 50 walnuts with healthy growth and relatively consistent maturity for picking each time, taking a walnut photo before picking, marking the picked walnut samples and the collected photo to realize a one-to-one correspondence, taking out the walnut kernels of the 50 walnuts picked each time, detecting the fat content by adopting an acid hydrolysis method according to the fat content determination in GB 5009.6-2016 food safety national standard food, establishing a mapping relation between the internal quality and the appearance representation of the walnut kernels according to the fat content change rule in different walnut kernels at different periods and the image characteristics of the walnut kernels at corresponding periods, dividing the walnut maturity levels according to the corresponding results, and recording the fat content in the walnut kernels at each maturity level, as in table 1.
TABLE 1 walnut maturity split criteria
Figure RE-GDA0003100934820000061
Step 201, according to the walnut maturity division standard shown in table 1, using a Lableimg image labeling tool to establish a walnut maturity detection data set in a Pascal VOC format.
Step 301, in a walnut plantation forest farm, starting from fruit development 103d, selecting 20 healthy experimental trees, selecting 10 walnuts which are healthy in growth, similar in development period and relatively consistent in maturity from each experimental tree, marking, fixing the same distance and the same angle, respectively shooting the same positions of 200 walnuts every day, using an image cutting tool to enable an image to only contain one walnut, recording the name, shooting date and maturity of the image in an xlsx format table, wherein the recording mode of the maturity of the walnuts in the xlsx format table is shown in fig. 3.
Step 401, constructing a walnut maturity detection and prediction method based on a visible light image, wherein an algorithm structure diagram provided by the invention is shown in fig. 4.
Step 402, inputting an RGB image to be detected, and performing image brightness value calculation on the input image, wherein a calculation formula of a brightness value L of the RGB image is as follows:
L=R×0.299+G×0.587+B×0.114
wherein R, G, B represents the color values of the three channels of an RGB image. Performing image processing on the RGB image with the brightness value L lower than 54 by using histogram equalization, brightness adjustment and contrast adjustment modes to enhance the color features and texture features of walnuts in the image; the histogram equalization method adopted comprises the following steps: converting the RGB color image into a YPbPr space, then only carrying out global histogram equalization and self-adaptive histogram equalization on a brightness channel, finally combining the brightness channel and the PbPr channel to form a color image, and then converting the color image back into the RGB space; the adjustment formula of brightness and contrast is as follows:
g(x)=αf(x)+β
wherein: f (x) is an original image data matrix, g (x) is an image data matrix after brightness and contrast adjustment, alpha and beta are commonly called gain and offset values, the contrast and the brightness of the image are respectively controlled, in the method, alpha is set to be 2, beta is set to be 30, and the brightness and the contrast of the image shot in a dark environment can be effectively adjusted.
Step 403, adjusting the length and width of the preprocessed image to 1024 × 1024, inputting the image into an improved Faster RCNN network, performing feature extraction on the image by using a ResNet101 network by the improved Faster RCNN network, taking out feature maps which are two, three, four and five times the size of the input image, inputting the feature maps into a BiFPN network for further feature extraction and feature fusion, and inputting a feature map which is output by the BiFPN network and has the length × width × channel of 32 × 32 × 1024 into an area suggestion network.
Step 404, after the feature map is input into the regional suggestion network, compressing the feature map into 512 channels, and then performing secondary classification on the target and the background by using a softmax classifier through the regional suggestion network for judging whether the interior of the candidate frame contains the object; using Bbox regression to preliminarily obtain candidate frame adjusting parameters for providing positions of candidate frames, then using a Soft-NMS algorithm to perform non-maximum suppression and remove overlapped candidate frames, multiplying the confidence coefficient of the current candidate frame by a weight function on the basis of the original NMS algorithm, selecting a Gaussian function by the weight function, wherein the Gaussian function can attenuate the adjacent detection frame score overlapped with the candidate frame M with the highest score, and the more the candidate frame highly overlapped with the frame M is, the more the score is attenuated, so that the relatively accurate candidate frame possibly having walnuts in the image is provided, and the NMS algorithm expression is as follows:
Figure RE-GDA0003100934820000071
the Soft-NMS algorithm expression is as follows:
Figure RE-GDA0003100934820000072
wherein S isiThe score of candidate box i is shown, M is the candidate box with the highest current score, IOU (M, b)i) Is a candidate frame biCross-over ratio with M. N is a radical oftAnd (4) setting an overlap threshold for the hyperparameter, wherein sigma is a width parameter of the Gaussian kernel function, and D is a final detection set.
Step 405, intercepting the feature map provided in step 403 by using the candidate frame obtained in step 404, performing size adjustment and channel adjustment on the obtained feature map, inputting the feature map into a region-of-interest pooling network, performing pooling and normalization processing on the feature map, outputting a 1 × 1 × 2048 feature map through a classification network as a processing result, wherein the classification network is constructed by adopting a three-layer SE _ ResNet structure, and the SE _ ResNet structure is shown in fig. 5. And finally, integrating characteristic diagram information through a full connecting layer, generating an accurate position of the walnut through Bbox regression, accurately classifying the maturity of the walnut through a softmax classifier, and evaluating the fat content of the walnut kernel under the maturity by integrating the experimental result of the step 101.
Step 406, mapping the precise position of the walnut obtained in the step 405 to an original image, intercepting image information of the region, adjusting the length × width × channels of the image of the region to 112 × 112 × 3, inputting the adjusted image into a ResNet18 network for feature extraction to obtain a 7 × 7 × 512 feature map, compressing the feature map to 256 through channels, inputting the constructed LSTM network, inputting the feature map in 256 batches, inputting 49 parameters in each batch, selecting 49 neuron nodes in the first layer of the LSTM network, returning to the sequence of True, selecting 7 neuron nodes in the second layer of the LSTM network, returning to the sequence of False, adopting a relu activation function for each neuron layer, connecting the neuron nodes in the second layer to a full connection layer, outputting a 4-dimensional vector, finally activating and outputting the maturity of the walnut after 3 days by using a softmax function, and predicting the fat content of the walnut under the maturity by synthesizing the experimental results of the step 101.
Step 501, training a walnut maturity detection and prediction method based on a visible light image, according to the algorithm provided by the invention, the structure diagram is shown in fig. 4, firstly freezing a walnut maturity prediction network based on an LSTM, feeding a walnut maturity detection data set into a walnut maturity detection network based on an improved Faster RCNN for training, and training the data set according to the following steps of 8: 1: 1, setting an Epoch to be 200, setting an initial learning rate to be 0.001, reducing the learning rate to be 1/10 at intervals of 10 epochs, optimizing a network by adopting an Adam algorithm, converging loss and stabilizing, selecting a parameter with the minimum loss value of a verification set as the weight of a walnut maturity detection network based on improved fast RCNN, wherein an Adam optimizer parameter updating formula is as follows:
Figure RE-GDA0003100934820000081
where t represents the number of updates,
Figure RE-GDA0003100934820000082
is mtThe correction of (2) is performed,
Figure RE-GDA0003100934820000083
is v istCorrection of
Figure RE-GDA0003100934820000084
Figure RE-GDA0003100934820000085
β1And beta2Is constant, controls exponential decay, mtIs an exponential moving average of the gradient, determined by the first moment of the gradient, vtIs a squared gradient, by gradientSecond order moment of mtAnd vtThe following formula is used for updating:
mt=β1*mt-1+(1-β1)*gt
Figure RE-GDA0003100934820000091
wherein g istFor the first derivation, in the present invention, some parameters are set as α ═ 0.001 and β as default1=0.9,β2=0.999,ε=10-8
Step 502, freezing a walnut maturity detection network based on improved fast RCNN, unfreezing a walnut maturity prediction network based on LSTM, training the walnut maturity prediction network based on LSTM by using a walnut maturity prediction data set, and carrying out comparison on the data set according to the following steps of 8: 1: 1, dividing a training set, a verification set and a test set, setting an Epoch to be 500, setting a learning rate to be 0.001, optimizing the network by adopting an Adam algorithm to ensure that a loss value is converged, and selecting the weight with the minimum loss value as the parameter weight of the walnut maturity prediction network.
Step 503, performing all unfreezing training on the improved FasterRCNN-based walnut maturity detection network and the LSTM-based walnut maturity prediction network, namely training the provided visible light image-based walnut maturity detection and prediction method, wherein a walnut maturity detection data set is adopted in the data set, and the data set is processed according to the following steps of: 1: 1, dividing a training set, a verification set and a test set, setting Epoch as 100, setting the learning rate as 0.001, optimizing the network by adopting an Adam algorithm to ensure that the total loss value is converged, and selecting the weight with the minimum loss value as the weight of the walnut maturity detection and prediction method based on the visible light image.
Step 601, executing an algorithm, loading the weight file obtained in the step 503, inputting the test image into a walnut maturity detection and prediction method based on a visible light image, outputting the maturity of each walnut in the image by the algorithm, evaluating the fat content of the walnut in the image according to the corresponding relation between the maturity and the fat content, predicting the maturity of the walnut three days later according to the characteristics of the walnut in the image, and evaluating the fat content of the walnut at the later time.

Claims (6)

1. A walnut maturity detection and prediction method based on visible light images is characterized by comprising the following steps:
firstly, grading the maturity of walnuts: taking 'Liaoning No. 1' walnut as an experimental variety, randomly selecting 50 healthy walnuts without diseases and with relatively consistent maturity from fruit development 103d every 3 days for picking, carrying out image acquisition on the walnuts before picking, carrying out fat content detection on walnut samples in batches in a picking time period, researching a mapping relation between the internal quality and appearance representation of the walnuts by combining images acquired at corresponding time, dividing walnut maturity grades, and recording fat content in walnut kernels with various maturity;
secondly, establishing a walnut maturity detection data set: marking the shot image by using a LabLeImg image marking tool according to the divided walnut maturity levels, and establishing a walnut maturity detection data set in a Pascal VOC format;
thirdly, establishing a walnut maturity prediction data set: in a walnut plantation, starting from fruit development 103d, selecting 20 healthy experimental trees, selecting 10 healthy and disease-free walnuts with relatively consistent maturity for protection and marking, fixing shooting distance and angle, shooting the same positions of 200 walnuts every day, cutting out an image containing only one walnut by using an image cutting tool, and recording the name, shooting date and maturity of the cut picture in an xlsx format table;
fourthly, constructing a walnut maturity detection network based on improved fast RCNN: firstly screening low-illumination walnut images, preprocessing the low-illumination walnut images by using histogram equalization, brightness adjustment and contrast adjustment to highlight color characteristics and texture characteristics of walnuts in the low-illumination images, then adjusting the length and width of the images to 1024 x 1024 and inputting the images into an improved Faster RCNN network, extracting walnut characteristics by using a ResNet101 network by using the improved Faster RCNN network to obtain a characteristic diagram, then taking out the characteristic diagram which is obtained by compressing the size of the input images by two times, three times, four times and five times, inputting the characteristic diagram into a BiFPN network for further characteristic extraction and characteristic fusion, taking out the characteristic diagram which is obtained by compressing the size of the BiFPN network by five times, transmitting the characteristic diagram to a regional suggestion network, in order to solve the condition that adjacent walnuts are missed to be detected, performing non-maximum value inhibition by using a Soft-NMS algorithm by the regional suggestion network to obtain candidate frames, inputting the candidate regions into a region-of-interest pooling network, outputting maturity results by a classifier, meanwhile, generating an accurate position of a suggestion frame, and obtaining the fat content of the walnut kernels under the maturity by inquiring the record of the first step, wherein in order to improve the detection precision of the walnut maturity, a classification network of a region-of-interest pooling network is constructed by adopting a three-layer SE _ ResNet structure, so that the maturity is classified while paying more attention to effective channel information, and the detection of the walnut maturity is more accurate;
fifthly, constructing a walnut maturity prediction network based on the LSTM: intercepting the walnut region in the original image by using the suggested frame position provided by the fourth step, compressing the length multiplied by the width multiplied by the channel of the image of the intercepted region to 112 multiplied by 112, inputting the image into an LSTM network for maturity prediction and fat content prediction after three days after the image is extracted by ResNet18 features;
sixthly, algorithm training: training the algorithms constructed in the fourth step and the fifth step, firstly freezing a walnut maturity prediction network based on LSTM, performing parameter training of the walnut maturity detection network based on improved fast RCNN by using a walnut maturity detection data set, setting Epoch to be 200, performing optimization training by using an Adam optimizer, and selecting the training weight with the minimum loss value of a verification set as the weight of the walnut maturity detection network based on improved fast RCNN after the loss value is continuously converged and stabilized; then freezing a walnut maturity detection network based on improved Faster RCNN, unfreezing a walnut maturity prediction network based on LSTM, training the walnut maturity prediction network based on LSTM by using a walnut maturity prediction data set, setting Epoch as 500, and continuously converging and stabilizing the loss value by adopting an Adam optimizer, selecting the training weight with the minimum loss value of the verification set as the weight of the walnut maturity prediction algorithm based on the LSTM, finally carrying out all unfreezing training on the walnut maturity detection network based on the improved fast RCNN and the walnut maturity prediction network based on the LSTM, training a walnut maturity detection and prediction method based on a visible light image, setting Epoch as 100, setting a learning rate as 0.001, using a walnut maturity detection data set, carrying out network optimization on a network by adopting an Adam algorithm to make a total loss value converge, and selecting a weight with the minimum loss value as a weight of the walnut maturity detection and prediction method based on the visible light image;
seventhly, executing an algorithm: inputting a test image into a walnut maturity detection and prediction method based on a visible light image, outputting the maturity of each walnut in the image, evaluating the fat content of the current walnut according to the corresponding relation between the maturity and the fat content, predicting the maturity of the walnut after three days according to the characteristics of the walnut in the image, and evaluating the fat content of the walnut at the moment.
2. The method for detecting and predicting the maturity of the walnut based on the visible light image as claimed in claim 1, wherein the maturity grading in the first step is as follows: picking walnut samples and collecting images once every 3 days from the fruit development of 103d, randomly selecting 50 healthy walnuts without diseases and with relatively consistent maturity for picking each time, and the walnut image is shot before picking, the picked walnut sample and the image are marked to realize one-to-one correspondence, taking out walnut kernels of 50 walnuts picked in each time period, detecting the fat content by adopting an acid hydrolysis method according to the determination of fat in GB 5009.6-2016 national food safety standard, according to the change rule of fat content in walnuts picked at different time, and the color characteristic, the texture characteristic and the cracking degree of the walnuts at corresponding time, the mapping relation of the internal quality and the appearance representation of the walnuts is explored, and further dividing the maturity grade of the walnut, and recording the fat content in the walnut kernels with different maturity grades.
3. The method according to claim 1, wherein the fourth step is based on low-illumination walnut image screening and image preprocessing in the construction of a walnut maturity detection network of improved fast RCNN, the brightness screening threshold is set to 54 to screen out low-illumination images, histogram equalization, brightness adjustment and contrast adjustment are performed on images with picture brightness lower than the threshold 54, and color features and texture features of walnuts in the images are enhanced.
4. The walnut maturity detection and prediction method based on visible light images as claimed in claim 1, wherein the fourth step is based on a walnut maturity detection network of improved fast RCNN, the improved fast RCNN algorithm uses a ResNet101 network to extract walnut features to obtain a feature map, uses a BiFPN network to further extract and fuse features, uses a Soft-NMS algorithm to replace a traditional NMS algorithm to perform non-maximum suppression so as to reduce the omission ratio of adjacent walnuts, and adds a SENET attention mechanism in a classification network of pooling of an area of interest, so that the network autonomously improves the attention degree of certain channel information in the feature map, and improves the detection accuracy.
5. The method as claimed in claim 1, wherein the fifth step of the walnut maturity prediction network based on the LSTM cuts the walnut position detected by the improved fast RCNN algorithm from the original image, compresses the length x width to 112 x 3, inputs the resenet 18 feature extraction network to obtain a 7 x 512 feature map, compresses the feature map channel to 256, and inputs the feature map channel to the walnut maturity prediction network based on the LSTM network.
6. The method for detecting and predicting the maturity of walnuts based on visible light images as claimed in claim 1, wherein said sixth step of algorithm training is a step-by-step combination training method using two different data sets for different parts of the same algorithm to complete the task of detecting and predicting the maturity of walnuts.
CN202110468741.2A 2021-04-28 2021-04-28 Walnut maturity detection and prediction method based on visible light image Active CN113192026B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110468741.2A CN113192026B (en) 2021-04-28 2021-04-28 Walnut maturity detection and prediction method based on visible light image

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110468741.2A CN113192026B (en) 2021-04-28 2021-04-28 Walnut maturity detection and prediction method based on visible light image

Publications (2)

Publication Number Publication Date
CN113192026A true CN113192026A (en) 2021-07-30
CN113192026B CN113192026B (en) 2023-08-04

Family

ID=76980409

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110468741.2A Active CN113192026B (en) 2021-04-28 2021-04-28 Walnut maturity detection and prediction method based on visible light image

Country Status (1)

Country Link
CN (1) CN113192026B (en)

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113793314A (en) * 2021-09-13 2021-12-14 河南丹圣源农业开发有限公司 Pomegranate maturity identification equipment and use method
CN113963239A (en) * 2021-12-23 2022-01-21 北京林业大学 Method for intelligently detecting maturity of camellia oleifera fruits
CN114187257A (en) * 2021-12-09 2022-03-15 江苏业派生物科技有限公司 Agricultural product display system and method based on data visualization
CN114972234A (en) * 2022-05-20 2022-08-30 连云港银丰食用菌科技有限公司 Edible mushroom quality monitoring method and system
CN115205716A (en) * 2022-08-11 2022-10-18 北京林业大学 Method, device and system for estimating oil content of olive fruits and storage medium
CN115331216A (en) * 2022-08-11 2022-11-11 北京林业大学 Walnut fruit maturity clustering identification method, device and system and storage medium
CN116267226A (en) * 2023-05-16 2023-06-23 四川省农业机械研究设计院 Mulberry picking method and device based on intelligent machine vision recognition of maturity
CN117442190A (en) * 2023-12-21 2024-01-26 山东第一医科大学附属省立医院(山东省立医院) Automatic wound surface measurement method and system based on target detection

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105738503A (en) * 2016-02-01 2016-07-06 浙江大学 Method for quickly predicting fatty acid content of walnuts based on electronic nose
WO2019055555A1 (en) * 2017-09-12 2019-03-21 Nantomics, Llc Few-shot learning based image recognition of whole slide image at tissue level
CN110781889A (en) * 2019-10-26 2020-02-11 苏州大学 Deep learning-based nondestructive testing method for total sugar content in blueberry fruits
AU2020102885A4 (en) * 2020-10-20 2020-12-17 Xijing University Disease recognition method of winter jujube based on deep convolutional neural network and disease image

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105738503A (en) * 2016-02-01 2016-07-06 浙江大学 Method for quickly predicting fatty acid content of walnuts based on electronic nose
WO2019055555A1 (en) * 2017-09-12 2019-03-21 Nantomics, Llc Few-shot learning based image recognition of whole slide image at tissue level
CN110781889A (en) * 2019-10-26 2020-02-11 苏州大学 Deep learning-based nondestructive testing method for total sugar content in blueberry fruits
AU2020102885A4 (en) * 2020-10-20 2020-12-17 Xijing University Disease recognition method of winter jujube based on deep convolutional neural network and disease image

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
马文强;张漫;李源;李民赞;杨莉玲;朱占江;崔宽波: "基于高光谱成像的核桃仁品质检测与分类方法", 分析化学, vol. 48, no. 012, pages 1737 - 1746 *

Cited By (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113793314A (en) * 2021-09-13 2021-12-14 河南丹圣源农业开发有限公司 Pomegranate maturity identification equipment and use method
CN114187257A (en) * 2021-12-09 2022-03-15 江苏业派生物科技有限公司 Agricultural product display system and method based on data visualization
CN113963239A (en) * 2021-12-23 2022-01-21 北京林业大学 Method for intelligently detecting maturity of camellia oleifera fruits
CN113963239B (en) * 2021-12-23 2022-03-29 北京林业大学 Method for intelligently detecting maturity of camellia oleifera fruits
CN114972234A (en) * 2022-05-20 2022-08-30 连云港银丰食用菌科技有限公司 Edible mushroom quality monitoring method and system
CN114972234B (en) * 2022-05-20 2024-01-23 连云港银丰食用菌科技有限公司 Edible fungus quality monitoring method and system
CN115205716A (en) * 2022-08-11 2022-10-18 北京林业大学 Method, device and system for estimating oil content of olive fruits and storage medium
CN115331216A (en) * 2022-08-11 2022-11-11 北京林业大学 Walnut fruit maturity clustering identification method, device and system and storage medium
CN115205716B (en) * 2022-08-11 2023-04-07 北京林业大学 Method, device and system for estimating oil content of olive fruits and storage medium
CN116267226A (en) * 2023-05-16 2023-06-23 四川省农业机械研究设计院 Mulberry picking method and device based on intelligent machine vision recognition of maturity
CN117442190A (en) * 2023-12-21 2024-01-26 山东第一医科大学附属省立医院(山东省立医院) Automatic wound surface measurement method and system based on target detection
CN117442190B (en) * 2023-12-21 2024-04-02 山东第一医科大学附属省立医院(山东省立医院) Automatic wound surface measurement method and system based on target detection

Also Published As

Publication number Publication date
CN113192026B (en) 2023-08-04

Similar Documents

Publication Publication Date Title
CN113192026B (en) Walnut maturity detection and prediction method based on visible light image
Zhou et al. Strawberry maturity classification from UAV and near-ground imaging using deep learning
CN113392775A (en) Sugarcane seedling automatic identification and counting method based on deep neural network
CN111753646A (en) Agricultural pest detection and classification method fusing population season growth and elimination information
CN115620151B (en) Method and device for identifying phenological period, electronic equipment and storage medium
CN112861810B (en) Artificial forest planting time automatic detection method based on time sequence remote sensing observation data
An et al. Real-time monitoring method of strawberry fruit growth state based on YOLO improved model
CN116543316B (en) Method for identifying turf in paddy field by utilizing multi-time-phase high-resolution satellite image
CN113705937A (en) Crop yield estimation method combining machine vision and crop model
Shu et al. Assessing maize lodging severity using multitemporal UAV-based digital images
CN115860581A (en) Method, device, equipment and storage medium for evaluating suitability of crop variety
Nandhini et al. PREDICTION OF CROP GROWTH USING MACHINE LEARNING BASED ON SEED FEATURES.
KR20190069648A (en) Method for measuring growth amount by image analyzing ginseng
CN114973024A (en) Method and system for monitoring and evaluating comprehensive evaluation index of mechanical cotton picking and defoliating effect
Zhao et al. Transient multi-indicator detection for seedling sorting in high-speed transplanting based on a lightweight model
CN112528726A (en) Aphis gossypii insect pest monitoring method and system based on spectral imaging and deep learning
Yang et al. Feature extraction of cotton plant height based on DSM difference method
Jannah et al. Tomato Maturity Detection System Using Color Histogram and Nearest Neighbor
CN112488230A (en) Crop water stress degree judging method and device based on machine learning
CN116052141B (en) Crop growth period identification method, device, equipment and medium
Rajkumar et al. Analysis of Seed Testing to Improve Cultivation using Image Processing Techniques
Lakshmi et al. Plant phenotyping through Image analysis using nature inspired optimization techniques
Aliiev The prospects of quantitative phenotyping of oilseed crops
CN112446339B (en) Crop remote sensing classification method for hierarchical deep learning
CN116612299A (en) SPAD value prediction method and system based on fresh leaf color recognition

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant