Search

CN-121982481-A - Deep learning-based real-time detection method for growth period of pholiota nameko

CN121982481ACN 121982481 ACN121982481 ACN 121982481ACN-121982481-A

Abstract

The invention discloses a real-time detection method for a yellow umbrella growth period based on deep learning, which relates to the technical field of intelligent monitoring of edible fungi, and aims to acquire a yellow umbrella full-growth period image by a greenhouse fixed-point camera and a mobile terminal in a cooperative manner, and adopts a multi-equipment synchronous calibration technology to ensure that the time synchronization error of an acquisition action is less than or equal to 10ms, so that the image coverage deviation caused by time difference is effectively avoided, meanwhile, the acquisition area thermodynamic diagram is used for ensuring that a supplementary acquisition image is not repeated and has no coverage blind area, and the supplementary acquisition instruction is automatically triggered by utilizing indexes such as image definition, illumination uniformity and the like, so that the integrity and the accuracy of data acquisition are obviously improved, and the synchronous calibration technology enables the integrity of acquired data to be improved to 99.2%, and provides a high-quality data basis for subsequent model training.

Inventors

  • YUE XUEJUN
  • ZHANG MINGJIA
  • Tan Xiucan
  • Xiao Kunhai
  • CAI XINPENG
  • LI HAIFENG
  • WEN JIAJIE
  • CHEN JUNZHI
  • ZHANG LE
  • CHEN QIANG
  • Huang Xuhuang
  • Kong Zijian

Assignees

  • 华南农业大学

Dates

Publication Date
20260505
Application Date
20260225

Claims (10)

  1. 1. The real-time detection method for the growth period of the pholiota nameko based on deep learning is characterized by comprising the following specific steps of: S1, data acquisition, preprocessing and enhancement, namely acquiring full-growth period images of the yellow umbrella through the cooperation of a greenhouse fixed-point camera and a mobile terminal, performing low-quality image rejection, effective image screening and self-adaptive histogram equalization preprocessing on the acquired images, marking by using LabelImg tools, dividing a data set according to a ratio of 8:1:1, and expanding the data set through a diffusion model and a YOLO enhancement technology; s2, constructing an improved detection model, namely replacing a backbone network standard C3k2 module with a C3k 2-DCNv-Dynamic module by taking YOLOv as a basic model, introducing a C2PSA attention mechanism, merging AFPN and the C2PSA module into a neck network, and constructing a complete framework of an input layer-backbone network-neck network-detection head; s3, model training and performance evaluation, namely training a model by adopting specified hardware configuration and optimizer parameters, and taking average mean value average precision, accuracy, recall rate, processing frame number per second, model parameter quantity and power consumption of edge equipment as evaluation indexes to ensure that the model reaches a preset convergence standard; S4, edge end deployment and harvest early warning are carried out, the trained model is deployed on edge equipment after being converted and optimized, grading harvest early warning logic is set, and harvest reminding is carried out in real time; S5, model iterative optimization, periodically collecting new data according to the growth period of the yellow umbrella, updating a data set, retraining and optimizing the model by adopting an incremental learning strategy, and continuously improving the adaptability and the robustness of the model.
  2. 2. The real-time detection method for the growth period of the yellow umbrella based on deep learning is characterized in that a multi-device synchronous calibration technology is adopted for collaborative collection of a fixed point camera and a mobile terminal in S1, and the method comprises the steps of firstly, deploying network time protocol synchronous service in an edge computing unit, issuing a unified time stamp to all the fixed point cameras and the mobile terminal, calibrating a local clock after equipment receiving, secondly, carrying out position location through a two-dimensional code mark preset by a mushroom frame before the mobile terminal is subjected to supplementary collection, analyzing frame number, layer number and area coordinate information in the two-dimensional code by adopting an ORB image recognition algorithm, carrying out association mapping on a supplementary collection area and a coverage area of the fixed point camera to generate a collected area thermodynamic diagram, and secondly, uploading an image thumbnail to an edge computing unit by the fixed point camera in real time in the collection process, analyzing illumination uniformity through a grey histogram entropy value, automatically sending a supplementary command to the mobile terminal of a corresponding area when a definition threshold is less than 80 or an illumination uniformity threshold is less than 1.2, and finally, carrying out position identification and carrying out time-position-time index association and image-four-dimensional index system marking on all the images after the collection is completed.
  3. 3. The deep learning-based real-time detection method for the growth period of the yellow umbrella according to claim 1, wherein the adaptive Mixup technology in S1 adopts a mixed weight calculation formula, and the formula is: wherein In order to mix the weights of the weights, For the adaptation of the coefficients of the scene, As a basis for the mixing coefficient, Adjusting a coefficient for sample scarcity; Sample scarcity for the current growth stage; Importance weights for the growth phase.
  4. 4. The real-time detection method of the yellow umbrella growth period based on the deep learning of claim 1 is characterized in that the image preprocessing in the S1 adopts a multi-stage quality screening and characteristic enhancement technology, and the specific implementation steps are that firstly, the primary screening is carried out, a screening algorithm based on image ambiguity is adopted, the Laplacian operator response value of the image is calculated, and when the response value is less than 50, the image is judged to be blurred and is removed; the method comprises the steps of adopting an overexposure screening algorithm based on a brightness histogram, judging as an overexposure image and eliminating when the proportion of pixel gray values in an image is more than 30%, adopting a screening algorithm based on a target shielding rate, extracting a fungus cap outline through an edge detection algorithm, calculating the ratio of the shielding area to the total area of the fungus cap, judging as a serious shielding image and eliminating when the ratio is more than 40%, secondly, carrying out secondary screening, adopting an effective image screening based on outline integrity, extracting the fungus cap edge through a Canny edge detection algorithm, combining Hough circle transformation to fit the fungus cap outline, judging as an invalid image and eliminating when the outline integrity is less than 75%, carrying out self-adaptive histogram equalization processing, adopting a contrast limiting self-adaptive histogram equalization algorithm, setting a contrast limiting parameter to be 2.0, dividing the image into 8×8 rectangular blocks, carrying out histogram equalization on each block, finally, carrying out image denoising processing, adopting a bilateral filtering algorithm, setting a space Gaussian function standard difference to be 5, setting a value similarity Gaussian function standard difference to be 75, and removing the noise and Gaussian salt in the image while retaining the detail noise of the fungus cap.
  5. 5. The deep learning-based real-time detection method for the growth period of the yellow umbrella according to claim 1, wherein the c3k2_ DCNv2_dynamic module in S2 adopts a Dynamic offset field prediction algorithm, and the formula is: wherein For convolution kernel at coordinates The amount of dynamic offset at which the position is to be changed, As the spatial location weight coefficient(s), Is the coordinates Is defined as a function of the spatial location characteristics of (a), Is a morphological feature weight coefficient which is a weighted coefficient of the morphological feature, Is the coordinates A morphological feature function of the location, Is a system compensation factor.
  6. 6. The real-time detection method of the yellow umbrella growth period based on deep learning of claim 1, wherein AFPN features in the S2 are fused by adopting a layered feature enhancement and two-way interaction technology, and the method comprises the specific implementation steps of firstly, respectively inputting three layers of P3/8, P4/16 and P5/32 features output by a backbone network into independent feature enhancement branches, uniformly adjusting the number of channels to 256 dimensions by each branch through 1X 1 convolution, eliminating channel differences of features with different dimensions, carrying out feature normalization by BatchNorm layers, reducing gradient vanishing risks, introducing nonlinear transformation by a ReLU activation function, and enhancing the expression capability of the features; secondly, constructing a top-down feature fusion channel, up-sampling P5/32 features to the same scale as P4/16 through bilinear interpolation, carrying out element-by-element addition on the P5/32 features, carrying out feature fusion and dimension unification through a 3X 3 convolution layer to obtain P4 intermediate fusion features, up-sampling the P4 intermediate fusion features to the same scale as P3/8, carrying out element-by-element addition on the P4 intermediate fusion features and the P3/8 enhancement features, carrying out 3X 3 convolution fusion to obtain P3 final fusion features, simultaneously constructing a bottom-up feature enhancement channel, down-sampling the P3/8 enhancement features to the same scale as P4/16 through 3X 3 convolution with a step length of 2, carrying out element-by-element addition on the P3/8 enhancement features, carrying out 3X 3 convolution fusion to obtain P4 downsampling fusion features, downsampling the P4 downsampling fusion features to the same scale as P5/32 through 3X 3 convolution with a step length of 2, carrying out element-by-element addition on the P5/32, carrying out 3X 3 convolution fusion to obtain P5 final fusion features, and again, introducing a channel attention mechanism, carrying out global average pooling on final fusion features of P3, P4 and P5 respectively to obtain channel-level feature vectors, calculating channel attention weights through two layers of full-connection layers and a Sigmoid activation function, multiplying the weights by corresponding fusion features channel by channel to strengthen the expression of important feature channels, and finally splicing the final fusion features of P3, P4 and P5 according to a scale sequence, compressing the number of channels to 512 dimensions through 1X 1 convolution to obtain the final multi-scale fusion features.
  7. 7. The method for real-time detection of a deep learning-based Umbelliferae growth cycle according to claim 1, wherein the model training in S3 adopts dynamic loss weight adjustment and early stop optimization techniques, and comprises the steps of firstly, dividing training stages and initializing loss weights, training initial focus bounding box positioning and target recognition basic capability culture, and setting classification loss Weight of 0.3, regression loss Weight of 0.5, target confidence loss Weight is 0.2, learning rate is linearly preheated from 0.0001 to 0.0012, the training medium term is put into the balanced learning stage, and the classification error rate of the verification set is calculated once every 10 rounds Error rate and regression ) If (if) Will then The weight is increased by 0.02, Weight decrease of 0.01, if Will then The weight is increased by 0.02, The weight is reduced by 0.01, The weight is kept to be 0.2 unchanged, the learning rate is attenuated to be 0.8 times of the current value every 50 rounds by adopting a cosine annealing strategy, the focus precision is optimized in the later stage of training, and the fixed loss weight proportion is as follows 、 、 The learning rate is maintained in a range of 0.0003-0.0005, a double early stopping mechanism is introduced, a first early stopping condition is set to enable a verification set mAP@0.5 to be continuously 15 rounds of non-lifting and fluctuation amplitude to be less than or equal to 0.2%, temporary early stopping is triggered and a current model is stored, a second early stopping condition is set to enable training rounds to reach 350 rounds of forced early stopping, model performance indexes are monitored in real time in the training process, model parameters with optimal performance are evaluated on the verification set for every 5 rounds of time, accuracy and recall rate are evaluated, finally, a model integration strategy is adopted, models with the verification set mAP@0.5 being ranked 5 before in the training process are selected, integration weights are calculated based on the accuracy of the verification set of each model, and a final detection result is output in a weighted voting mode.
  8. 8. The deep learning-based real-time detection method for the growth period of the yellow umbrella according to claim 1, wherein the edge end deployment in the S4 adopts a model quantization and reasoning acceleration optimization technology, and the implementation steps are that firstly, a model format conversion and redundancy layer is removed, a PyTorch model after training is exported to ONNX format, a Dropout, batchNorm training mode redundancy layer is automatically removed in the export process, a network structure necessary for reasoning is reserved, and meanwhile, the input dimension of the model is fixed to 1280 multiplied by 1024 multiplied by 3, so that the dynamic dimension adaptation cost in the reasoning process is reduced; secondly, model quantization optimization, adopting TensorRT tools to quantize ONNX models from FP32 precision to FP16 precision, simultaneously starting a sparse optimization function, performing sparse marking on parameters with weight absolute value smaller than 0.001 in a network, skipping computation of sparse parameters in the reasoning process to reduce the model storage capacity by 50 percent and reduce the computation amount by 35 percent, thirdly, GPU accelerating data preprocessing, based on a DALI library construction pipeline of TensorRT, migrating image reading, resize, normalization and channel conversion operation to GPU execution, reducing the data preprocessing time consumption by parallel computation to reduce the single frame preprocessing time from 8ms to 2ms, then optimizing and constructing by a reasoning engine, starting LayerNorm fusion, convolution-activation fusion and matrix multiplication fusion optimization options of TensorRT, fusing continuous computation layers in the network into a single computation unit, improving the parallel computation efficiency, simultaneously distributing independent video memory space for the reasoning engine, finally, multithreading scheduling and deployment verification, setting the number of reasoning lines on edge equipment to be 1.5 times of CPU core number, adopting thread pool dynamic scheduling task, simultaneously establishing a mechanism for multiplexing cache results of 3 continuous detection frames, and performing performance verification after deployment is completed.
  9. 9. The deep learning-based real-time detection method for the growth period of the yellow umbrella according to claim 1 is characterized in that the harvesting early warning in the step S4 adopts a hierarchical response and linkage notification technology, and the method comprises the specific implementation steps of firstly setting an early warning threshold and a hierarchical standard, setting the threshold of the optimal edible fungus caps of a single cultivation frame to be 50 based on the growth characteristics of the optimal edible period of the yellow umbrella, setting the threshold of the confidence mean value to be 0.88, triggering a first-stage early warning to be immediately harvested when the detection number is more than 50 and the confidence mean value is more than 0.88, triggering a second-stage early warning to be harvested within 24 hours when the detection number is more than 30 and less than 30 and the confidence mean value is more than 0.85, triggering a third-stage early warning to be focused in a growth state within 48 hours when the detection number is more than 10 and the confidence mean value is more than 0.8, secondly, automatically generating and transmitting early warning information after the edge equipment detects the early warning conditions, comprising early warning levels, numbers of the cultivation frames, the optimal edible fungus caps, the confidence mean value and the recommended time content, transmitting the early warning information to a factory cultivation management platform through a network, simultaneously triggering a real-time management terminal to send the early warning to the factory, and a real-time management platform to send the corresponding to the high-time warning command, and the high-level is triggered to be in synchronization with the high-level, and the high-time warning command is sent to the optimal, and the high-quality control platform is triggered, and the high-quality control platform is in response to be in response to the state, and the high-time, and the high-quality control state is triggered, and the high-quality is in response to be analyzed, and the high-quality is in real time, and the quality is analyzed, and the quality is in response to be in time, and the growth state is stored.
  10. 10. The deep learning-based real-time detection method for the growth period of the yellow umbrella according to claim 1, wherein the incremental learning in the step S5 adopts a sample screening and parameter self-adaptive updating technology, and the method comprises the following steps of firstly, collecting a detection log and image data of edge equipment after each tide is finished, screening false detection samples through manual auditing, classifying the false detection samples into three types of category misjudgment, boundary frame offset and background misdetection according to types, and independently establishing a sub-data set for each type of samples, wherein the number of the false detection samples of each type is more than or equal to 50; secondly, sample pretreatment and data set updating, re-labeling the screened false detection samples, expanding according to a data enhancement strategy of S1, merging the treated false detection samples with corresponding type samples of an original training set, keeping the proportion of samples in each growth stage of the updated data set balanced, in a matrix stage, namely a young mushroom stage, namely an optimal eating stage, namely a mature stage=1:1.2:1.5:1, configuring incremental training parameters, freezing 70% of parameters in front of a backbone network of the model, fully training neck network and detection head parameters, introducing a distillation loss term in a loss function, wherein the distillation loss weight is 0.3, the original loss weight is 0.7, the distillation loss adopts a difference between a new model and an original model, setting the training round to be 100, the learning rate is 0.3 times of the initial training learning rate, and batchsize keeps 12 unchanged, finally, after the incremental training is completed, evaluating the model performance on the updated verification set, comparing the mAP@0.5, the accurate rate, the recall rate and the recall rate of the new model and the original model are improved, the error rate is more than or equal to 1.0 percent and more than or equal to 0.5 percent if the error rate is reduced by more than 35.0 percent, and replacing the original model to be deployed on the edge equipment, otherwise, retaining the original model, and carrying out incremental training again after supplementing more false detection samples for the next tide, and archiving new model parameters which do not pass the evaluation.

Description

Deep learning-based real-time detection method for growth period of pholiota nameko Technical Field The invention relates to the technical field of intelligent monitoring of edible fungi, in particular to a real-time detection method for growth period of yellow umbrella based on deep learning. Background Along with the rapid development of the edible fungus industry, the industrial cultivation technology has become an important means for improving the yield and quality of edible fungi. As a high-value edible fungus, the real-time monitoring and management of the growth period of the yellow umbrella is important for improving the yield and ensuring the quality. The traditional edible fungus growth monitoring mainly relies on manual inspection, so that the efficiency is low, and the accurate control of the growth period is difficult to achieve. In recent years, along with the fusion application of the Internet of things, big data and artificial intelligence technology, the intelligent monitoring technology gradually becomes a research hotspot in the field of edible fungus cultivation. The image recognition technology based on deep learning has great potential in monitoring the growth state of edible fungi due to the strong feature extraction and classification capability. The traditional edible fungus growth monitoring method has a plurality of limitations. Firstly, the manual inspection mode is time-consuming and labor-consuming, is easily affected by subjective factors, and results of monitoring are inaccurate and untimely. Secondly, when the traditional image recognition technology is used for processing complex and changeable edible fungus growing environments, challenges such as different image quality, large illumination condition change and the like are often faced, so that the recognition precision is low and the robustness is poor. Particularly in the monitoring of the growth cycle of edible fungi such as yellow umbrella, the traditional method is difficult to realize the accurate monitoring of the whole growth cycle because the morphological characteristics of different growth stages are obviously different. In addition, the lack of efficient utilization of historical data and model continuous optimization mechanisms in the traditional technology results in insufficient adaptation capability of the model in the face of new data and new environments. Aiming at the problems of low efficiency, poor precision, insufficient adaptability and the like of the traditional edible fungus growth monitoring technology, the invention provides a real-time detection method for the growth period of the yellow umbrella based on deep learning, which is particularly important. Disclosure of Invention The invention aims to make up the defects of the prior art, provides a real-time detection method for the growth period of the yellow umbrella based on deep learning, which can acquire the full-growth period image of the yellow umbrella through the cooperation of a greenhouse fixed-point camera and a mobile terminal, the integrity and accuracy of data acquisition are ensured by combining a multi-device synchronous calibration technology, meanwhile, the model is continuously optimized by adopting an incremental learning strategy, and the model is updated regularly according to new data, so that the adaptability and the robustness of the model are enhanced. The invention provides a real-time detection method for the growth period of a yellow umbrella based on deep learning, which comprises the following specific steps of: S1, data acquisition, preprocessing and enhancement, namely acquiring full-growth period images of the yellow umbrella through the cooperation of a greenhouse fixed-point camera and a mobile terminal, performing low-quality image rejection, effective image screening and self-adaptive histogram equalization preprocessing on the acquired images, marking by using LabelImg tools, dividing a data set according to a ratio of 8:1:1, and expanding the data set through a diffusion model and a YOLO enhancement technology; s2, constructing an improved detection model, namely replacing a backbone network standard C3k2 module with a C3k 2-DCNv-Dynamic module by taking YOLOv as a basic model, introducing a C2PSA attention mechanism, merging AFPN and the C2PSA module into a neck network, and constructing a complete framework of an input layer-backbone network-neck network-detection head; s3, model training and performance evaluation, namely training a model by adopting specified hardware configuration and optimizer parameters, and taking average mean value average precision, accuracy, recall rate, processing frame number per second, model parameter quantity and power consumption of edge equipment as evaluation indexes to ensure that the model reaches a preset convergence standard; S4, edge end deployment and harvest early warning are carried out, the trained model is deployed on edge equipment after being converted and op