CN-121982522-A - SAFMN-based YOLOv8 soilless culture detection method
Abstract
The invention discloses a SAFMN-based YOLOv soilless culture detection method, which is characterized in that Neck parts of a YOLOv model are improved, and SAFMN modules are embedded to realize multi-scale feature self-adaptive fusion, so that detection accuracy in dense scenes is improved. Meanwhile, by combining a growth state quantification scheme of multi-feature fusion, the dynamic monitoring of the growth state of the plant and the accurate feedback of nutrient solution regulation are realized.
Inventors
- ZHOU MENG
- HU BING
- XIE JIANNING
- YANG GUOFENG
- YANG KAI
- Zhai Wanwan
- SI WEIFENG
- Li Gaojia
- YANG FEIFEI
- LIU XINGXING
- ZHANG HAN
- ZHOU HONGSHUN
- ZHANG CHENG
- WANG MIN
- GOU XIAODONG
- ZHAO RUIQI
- WU LIJIA
- FENG WEIMING
- YANG FEI
- Niu Zengrui
- Qin Shaoshuai
- XU CHANGMING
- DENG YUYANG
Assignees
- 中铁十四局集团西北工程有限公司
- 中铁十四局集团有限公司
Dates
- Publication Date
- 20260505
- Application Date
- 20260209
Claims (9)
- 1. YOLOv8 soilless culture detection method based on SAFMN is characterized by comprising the following steps: step 1, acquiring multi-mode data in a soilless culture environment, and carrying out normalization, noise filtering, data enhancement and data fusion treatment on the multi-mode data; step 2, fusing the data obtained in the step 1 Input to the back bone portion of YOLOv model, extract the initial feature map by convolutional layer and downsampling , wherein, 、 And The height, width and channel number of the feature map are respectively; Step 3, performing multi-scale convolution operation on the initial feature map to generate a multi-scale feature map set : Wherein, the Representing the number of multi-scale convolution operations; representing a multi-scale convolution operation, including for each scale Using convolution kernel size as Step size of Is convolved to generate a feature map The convolution kernel used is different in scale under different scales, so that a group of feature graphs with different resolutions are generated to capture features under different scales; And 4, dynamically adjusting the weight of each scale characteristic by using a SAFMN module to carry out self-adaptive fusion, wherein the method specifically comprises the following steps: Wherein, the Is the first The self-adaptive weight of each scale feature is calculated through softmax, and specifically comprises the following steps: Wherein, the , Is that Feature fusion parameters of convolution learning; and 5, predicting by using the Head of YoLOv, wherein the method specifically comprises the following steps: Wherein, the Is the pre-measurement head for classification and bounding box regression in YOLOv, Is a parameter of the Head part; step 6, according to the fused data obtained in the step 1 Predicted value obtained in step 5 Setting a loss function; and 7, using gradient descent to the loss function obtained in the step 6 to minimize loss, wherein the parameter updating is specifically as follows: Wherein, the In order for the rate of learning to be high, The loss function is represented by a function of the loss, A network representing the model, a multi-scale convolution layer and all the learnable parameters of all the prediction heads, Representation SAFMN module for computing adaptive weights A convolution kernel parameter; step 8, obtaining the improved YOLOv detection model after complete training obtained in the step 7, inputting the data to be detected, and obtaining a prediction result Wherein The information of the bounding box is represented, The result of the classification is indicated, Representing the confidence level of the prediction, Representing the number of bounding boxes; Step 9, synchronously acquiring environmental sensor data according to the prediction result of the step 8, and carrying out fusion analysis to evaluate the plant growth stage; and 10, setting an ideal plant growth state and dynamically regulating and controlling the nutrient solution according to the plant growth stage evaluation result obtained in the step 9.
- 2. The YOLOv8 soilless culture detection method based on SAFMN according to claim 1, wherein the step1 is specifically: step 1-1, obtaining RGB image data as , Respectively representing the height and width of the image, 3 represents three channels of RGB, normalizes RGB image data, specifically: Wherein, the Is the mean value of the RGB channels, Is the standard deviation; Step 1-2 normalizing the image by geometric transformation and color variation The data enhancement is carried out, specifically: Wherein, the In order to rotate the matrix is rotated, In order for the brightness gain to be high, Is an offset value; step 1-3, acquiring depth data acquired by a depth camera Each pixel value represents the depth of the point from the camera, and noise filtering is performed on the depth data, specifically: Wherein, the For controlling the weight of the spatial distance; for controlling the weight of the depth value similarity, As a result of the normalization factor, Is used for the display of the display device, Representing pixels Is used in the neighborhood of (a), Representation of Middle AND Adjacent pixel locations; Step 1-4 of filtering the depth data And (3) carrying out normalization operation to convert the depth value into a range of [0,1], wherein the normalization operation is specifically as follows: Wherein, the Respectively maximum value and minimum value of depth data; Step 1-5, acquiring environmental sensor data And normalizing; Step 1-6, normalizing environmental sensor data Abnormal values are removed by using a 3-time standard deviation rule, and the method specifically comprises the following steps: step 1-7, adopting a weighted fusion mode to fuse the multi-mode data, specifically: Wherein, the Is a learnable fusion weight.
- 3. The YOLOv8 soilless culture detection method based on SAFMN according to claim 2, wherein the step 6 is specifically: step 6-1, calculating the regression loss of the boundary frame, which is specifically as follows: Wherein, the To predict the euclidean distance of the center point of the frame from the real frame, To minimize the diagonal distance of the bounding box, To measure the phase velocity of the aspect ratio, As the weight factor of the weight factor, To predict the center coordinates, width and height of the frame, The center coordinates, width and height of the real frame; Step 6-2, calculating cross entropy loss for measuring classification loss, specifically: Wherein, the As the total number of categories to be considered, Is of the category Is used to determine the prediction probability of (1), To indicate the function, if the true category Is that The value is 1, otherwise 0; Step 6-3, calculating confidence loss, which is specifically as follows: Wherein, the Indicating whether the target is actually present, if so, it is 1, otherwise it is 0, Representing confidence of model predictions; Step 6-4, calculating the regression loss of the boundary frame Cross entropy loss Confidence loss To obtain the target loss functions YOLOv and SAFMN, specifically: Wherein, the , , As a balance factor, the balance factor is, Is SAFMN modules Regularization term to prevent overfitting.
- 4. A YOLOv8 soilless culture detection method based on SAFMN according to claim 3, wherein said step 9 is specifically: Step 9-1, calculating leaf area index, specifically: Wherein the method comprises the steps of For the area of the detection frame of each plant, Respectively representing width and height; Step 9-2, estimating the plant height, specifically: step 9-3, calculating a normalized vegetation index, which specifically comprises the following steps: wherein NIR is near infrared band reflectivity, R is red band reflectivity; Step 9-4, evaluating the growth stage, specifically: Wherein, the Representing a growth stage assessment function.
- 5. The YOLOv8 soilless culture detection method based on SAFMN as claimed in claim 4, wherein the learning rate is 0.001.
- 6. An electronic device comprising a processor and a memory, the memory for storing a computer program, the processor for executing the computer program stored by the memory to cause the electronic device to perform the method of any one of claims 1 to 5.
- 7. A computer readable storage medium, on which a computer program is stored, which computer program, when being executed by a processor, implements the method according to any one of claims 1 to 5.
- 8. A chip comprising a processor for calling and running a computer program from a memory, causing a device on which the chip is mounted to perform the method of any one of claims 1 to 5.
- 9. A computer program product comprising a computer storage medium storing a computer program comprising instructions executable by at least one processor, the instructions when executed by the at least one processor implementing the method of any one of claims 1 to 5.
Description
SAFMN-based YOLOv8 soilless culture detection method Technical Field The invention belongs to the technical field of computer vision, and particularly relates to a YOLOv soilless culture detection method based on SAFMN. Background Soilless culture technology is used as a modern agricultural production mode, and has been widely used in the planting of crops such as vegetables, flowers, herbal medicines and the like in recent years due to the remarkable advantages of high-efficiency utilization of resources, reduced land dependence and improved crop yield and quality. The soilless culture can accurately control the growth environment of plants by using nutrient solution or solid matrix to replace the traditional soil, thereby realizing the efficient production of crops. However, with the popularization of soilless culture technology, especially the popularization of multilayer dense planting modes, a series of technical problems are gradually revealed, especially in the aspects of real-time monitoring of plant growth state and accurate regulation and control of nutrient solution. In a multilayer dense planting scene of soilless culture, plant branches and leaves are staggered and are seriously blocked, so that a traditional visual detection model (such as a YOLO series) has higher false detection rate and omission rate on leaf boundaries and color feature extraction. In the aspect of accurate regulation and control of nutrient solution, manual experience or single sensor data are mainly relied on at present. The artificial experience mode requires a grower to have abundant experience, and the growing state of the grower is judged through the appearance of the plant, so that the subjectivity is high and the efficiency is low. Sensor-based systems often rely on a single sensor (e.g., pH sensor, EC sensor) to monitor the status of a nutrient solution, lack of overall perception of plant growth status, and are difficult to achieve precise regulation. Aiming at the defects, the prior art tries to improve the detection precision and the regulation effect by improving a visual detection model or introducing a multi-sensor fusion technology, but still faces the problems that the visual detection model has poor adaptability and is difficult to cope with complex problems of interleaving and shielding of branches and leaves, the multi-sensor data fusion aspect lacks effective algorithm support and is difficult to realize comprehensive quantitative analysis of plant growth states, and the fine granularity feature extraction capability is insufficient and is difficult to extract key features such as blade edges, gradual change of color features and the like, so that the further improvement of the detection precision is limited. Disclosure of Invention In order to overcome the defects of the prior art, the invention provides a YOLOv soilless culture detection method based on SAFMN, and by improving Neck part of a YOLOv model and embedding SAFMN modules, multi-scale feature self-adaptive fusion is realized, so that detection precision in dense scenes is improved. Meanwhile, by combining a growth state quantification scheme of multi-feature fusion, the dynamic monitoring of the growth state of the plant and the accurate feedback of nutrient solution regulation are realized. The technical scheme adopted for solving the technical problems is as follows: step 1, acquiring multi-mode data in a soilless culture environment, and carrying out normalization, noise filtering, data enhancement and data fusion treatment on the multi-mode data; step 2, fusing the data obtained in the step 1 Input to the back bone portion of YOLOv model, extract the initial feature map by convolutional layer and downsampling, wherein,、 AndThe height, width and channel number of the feature map are respectively; Step 3, performing multi-scale convolution operation on the initial feature map to generate a multi-scale feature map set : Wherein, the Representing the number of multi-scale convolution operations; representing a multi-scale convolution operation, including for each scale Using convolution kernel size asStep size ofIs convolved to generate a feature mapThe convolution kernel used is different in scale under different scales, so that a group of feature graphs with different resolutions are generated to capture features under different scales; And 4, dynamically adjusting the weight of each scale characteristic by using a SAFMN module to carry out self-adaptive fusion, wherein the method specifically comprises the following steps: Wherein, the Is the firstThe self-adaptive weight of each scale feature is calculated through softmax, and specifically comprises the following steps: Wherein, the ,Is thatFeature fusion parameters of convolution learning; and 5, predicting by using the Head of YoLOv, wherein the method specifically comprises the following steps: Wherein, the Is the pre-measurement head for classification and bounding box regression i