Search

CN-121998992-A - Mango anthracnose detection method and device

CN121998992ACN 121998992 ACN121998992 ACN 121998992ACN-121998992-A

Abstract

The invention relates to a mango anthracnose detection method and device, which take mangoes as analysis objects, construct a network to be trained based on CBAM attention mechanisms, train and obtain a mango anthracnose recognition model, comprehensively detect mango multispectral images, realize the efficient recognition of mango anthracnose, design and realize the corresponding device of the detection method, and lay out multi-angle halogen lamp light sources (7) in the lower space based on the upper and lower space division in a box (1), construct an illumination environment which is shadowless and has uniform illumination of the halogen lamp sources, shoot the lower mangoes by a multispectral camera (15) arranged in the upper space, obtain the shot images of the mangoes corresponding to preset channels, furthest reduce the interference of natural light on image imaging, and the layout design of the device structure can obtain the practical application effect of the device with small whole volume and convenient use, realize the efficient and rapid recognition of the mango anthracnose, and have high recognition accuracy and wide market application value.

Inventors

  • ZHANG XIAOLEI
  • ZHANG XIAOFEI
  • Pan Qianjiang
  • YANG MENGFEI

Assignees

  • 南京农业大学三亚研究院
  • 南京农业大学

Dates

Publication Date
20260508
Application Date
20260410

Claims (9)

  1. 1. A mango anthracnose detection method is characterized by comprising the following steps of A to C, obtaining a mango anthracnose identification model, and then applying the mango anthracnose identification model to realize anthracnose area identification aiming at a target mango multispectral image; Step A, acquiring a preset number of mango multispectral sample images, wherein each mango multispectral sample image is respectively synthesized by shooting images of corresponding preset channels of mangoes, and the anthrax disease area in each mango multispectral sample image is known, so that a single sample is formed by a single mango multispectral sample image to obtain a sample set, and then the step B is counted; Step B, based on the feature extraction sub-network introducing CBAM attention mechanism, connecting the classification sub-networks in series, constructing a network to be trained, and entering the step C; Step C, based on a sample set, taking a mango multispectral sample image in the sample as input, taking an anthracnose disease area in the mango multispectral sample image as output, and training a network to be trained to obtain a mango anthracnose recognition model; The characteristic extraction sub-network of the CBAM attention mechanism introduced in the step B comprises at least two convolution processing units which are sequentially connected in series from an input end to an output end, wherein the input end of the first convolution processing unit in sequence forms the input end of the characteristic extraction sub-network, namely the input end of the network to be trained, and the output end of the last convolution processing unit in sequence forms the output end of the characteristic extraction sub-network; The convolution processing units respectively comprise a convolution layer, a ReLU activation layer, a CBAM attention layer and a pooling layer which are sequentially connected in series from an input end to an output end, wherein the input end of the convolution layer forms the input end of the convolution processing unit, the output end of the pooling layer forms the output end of the convolution processing unit, the pooling layer in the first convolution processing unit in sequence is the largest pooling layer, and the pooling layer in the last convolution processing unit in sequence is the global average pooling layer; the classifying sub-network comprises a stretching layer, a Dropout layer, a full-connection layer and a Softmax layer which are sequentially connected in series from an input end to an output end, wherein the input end of the stretching layer forms the input end of the classifying sub-network, and the output end of the Softmax layer forms the output end of the classifying sub-network, namely the output end of the network to be trained.
  2. 2. The method for detecting mango anthracnose according to claim 1, wherein in the step A, after each mango multispectral sample image is obtained, normalization updating is performed on pixel values of each pixel position in each mango multispectral sample image according to each mango multispectral sample image, so that each mango multispectral sample image is updated respectively; based on the obtained mango anthracnose identification model, carrying out normalization updating on pixel values of each pixel position in the target mango multispectral image, and then applying the mango anthracnose identification model to realize anthracnose area identification on the target mango multispectral image.
  3. 3. The method for detecting mango anthracnose according to claim 1, wherein the CBAM attention layers in the convolution processing units are identical in structure, each CBAM attention layer comprises a channel attention module, a space attention module, a first fusion module and a second fusion module, in the structure of the CBAM attention layers, the input end of the channel attention module is connected with one input end of the first fusion module, the connection position forms the input end of the CBAM attention layer, the output end of the channel attention module is abutted to the other input end of the first fusion module, the output end of the first fusion module is abutted to the input end of the space attention module and one input end of the second fusion module respectively, the output end of the space attention module is abutted to the other input end of the second fusion module, and the output end of the second fusion module forms the output end of the CBAM attention layer; The channel attention module comprises a global maximum pooling layer, a global average pooling layer, a shared full-connection layer, a splicing module and a Sigmoid activation layer, wherein the input end of the maximum pooling layer is connected with the input end of the average pooling layer, the connection position forms the input end of the channel attention module, the output end of the maximum pooling layer and the output end of the average pooling layer are respectively abutted to the two input ends of the shared full-connection layer, the two output ends of the shared full-connection layer are respectively abutted to the two input ends of the splicing module, the shared full-connection layer respectively processes the feature map output by the maximum pooling layer and the feature map output by the average pooling layer, and respectively outputs results to the two input ends of the splicing module, the splicing module performs addition processing on the two input results, the output end of the splicing module is abutted to the input end of the Sigmoid activation layer, and the output end of the Sigmoid activation layer forms the output end of the channel attention module; The spatial attention module comprises a maximum pooling layer, an average pooling layer, a splicing module, a convolution layer and a Sigmoid activation layer, wherein the input end of the maximum pooling layer is connected with the input end of the average pooling layer, the connection position forms the input end of the spatial attention module, the output end of the maximum pooling layer and the output end of the average pooling layer are respectively butted with the two input ends of the splicing module, the output end of the splicing module is butted with the input end of the convolution layer, the output end of the convolution layer is butted with the input end of the Sigmoid activation layer, and the output end of the Sigmoid activation layer forms the output end of the spatial attention module.
  4. 4. The method for detecting mango anthracnose according to claim 1, wherein in the training process of the network to be trained in the step C, exponential moving average processing is performed on the result of the loss function, smoothing of the loss result is achieved, and whether training is converged is judged according to the smoothing result.
  5. 5. A mango anthracnose detection device is characterized by comprising a box body (1), a power supply (4), a buffer pad (11), a laminate (13), an embedded development board (14), a multispectral camera (15), a door body (20) and at least two halogen lamp light sources (7), wherein the laminate (13) is horizontally arranged at a preset height position inside the box body (1), the interior of the box body (1) is divided into an upper space and a lower space by the laminate (13), the power supply (4), the embedded development board (14) and the multispectral camera (15) are arranged in the upper space inside the box body (1), the power supply (4) is respectively connected with the embedded development board (14) and the multispectral camera (15) to supply power, the multispectral camera (15) is in butt joint with the embedded development board (14), the buffer pad (11) is arranged on the bottom surface of the lower space inside the box body (1), the central area of the upper surface of the buffer pad (11) forms a mango placing area, each halogen lamp light source (7) is arranged in the lower space inside the box body (1), each mango placing area is arranged in the lower space inside the mango placing area, each halogen lamp light source (7) is arranged at the front position outside the mango placing area (7), and the halogen lamp light sources (7) are respectively arranged at the position outside the upper position, and no shadow is provided for each halogen lamp light source (7, and is respectively, and the halogen lamp source is placed in the shadow area, the mango anthracnose detection method comprises the steps of enabling a halogen light source to illuminate a uniform illumination environment, enabling a lens (12) of a multispectral camera (15) to vertically downwards penetrate through preset through holes in a laminate (13) and be located right above a mango placing area, enabling a side face of a box body (1) to correspond to the position of the lower space in the box body, enabling the door body (20) to be used for sealing and opening the opening, enabling each halogen light source (7) to illuminate the mango placing area based on mango placing areas, enabling the multispectral camera (15) to shoot mangoes, obtaining shooting images of the corresponding preset channels of the mangoes, sending the shooting images to an embedded development board (14), and enabling the embedded development board (14) to execute the mango anthracnose detection method according to the shooting images of the corresponding preset channels of the received mangoes.
  6. 6. The mango anthracnose detection device according to claim 5, further comprising brackets which are respectively in one-to-one correspondence with the halogen lamp light sources (7), wherein each bracket has the same structure, each bracket comprises a vertical rod (8), a height adjusting piece (5) and a universal piece (6), in the bracket structure, the vertical rod (8) is vertically arranged in the peripheral area of the lower space bottom surface in the box body (1) corresponding to the mango placing area, through holes penetrating through two opposite end surfaces are arranged on the height adjusting piece (5), the inner diameter of each through hole is matched with the outer diameter of the vertical rod (8), mounting holes are arranged on the side surfaces of the height adjusting piece (5) corresponding to the through holes in the straight line direction, and the height adjusting piece (5) is sleeved on the vertical rod (8) through the through holes and is arranged at each height position on the vertical rod (8); the universal piece (6) is including articulated connection each other, and each other angulated pivoted base plate and mounting panel, the base plate surface sets up the mounting hole, mounting hole each other position butt joint on base plate and the altitude mixture control spare (5) and pass through bolt through connection, the base plate surface and its side towards altitude mixture control spare (5) parallel contact each other, and each other angulation rotation, set up the light source mount pad on the surface of mounting panel back to the base plate direction for install corresponding halogen lamp light source (7), based on the installation of support, realize the regulation of halogen lamp light source (7) irradiation angle.
  7. 7. The mango anthracnose detection device according to claim 5, wherein: the LED lamp box also comprises universal pieces (6) and shading cover plates (21) which are respectively in one-to-one correspondence with the halogen lamp light sources (7), wherein at least two longitudinal straight sliding grooves penetrating through the inner space and the outer space are arranged in the area corresponding to the inner lower space on the side surface of the box body (1), the number of the sliding grooves is equal to that of the halogen lamp light sources (7), the sliding grooves, the halogen lamp light sources (7), the universal pieces (6) and the shading cover plates (21) are in one-to-one correspondence, the universal pieces (6) are positioned in the inner lower space of the box body (1), the universal pieces (6) are identical in structure, the universal pieces (6) respectively comprise a base plate and a mounting plate which are hinged with each other and rotate at an angle, in the structure of the universal pieces (6), mounting holes are formed in the surface of the base plate, the mounting holes on the base plate are in butt joint with the corresponding sliding grooves on the side surface of the box body (1) and are connected through bolts, the surface of the base plate and the area facing the inner side surface of the box body (1) are in parallel to each other and rotate at an angle, the universal pieces (6) are connected with the sliding grooves along the height positions, the base plate and form angles, the angles are positioned in the positions, the base plate is corresponding to the light sources (7) on the side surface of the base plate (1) and is arranged on the base plate, and is applied to the base plate (7) corresponding to the side surface of the base plate, the illumination angle of the halogen lamp light source (7) is adjusted, and each shading cover plate (21) is respectively covered and installed on the corresponding sliding groove on the side surface of the box body (1) from the outside of the box body (1).
  8. 8. The mango anthracnose detection device according to claim 6 or 7, wherein in the structure of the universal piece (6), two opposite positions on the edge of the base plate extend two side plates respectively towards the same side direction of the base plate, the two opposite positions on the edge of the mounting plate are parallel to each other, the two opposite positions on the edge of the mounting plate extend two side plates respectively towards the same side direction of the mounting plate, the two side plates are parallel to each other, the two side plates on the base plate and the two side plates on the mounting plate are in one-to-one correspondence with each other, the two side plates on the base plate are respectively and partially and movably connected with the corresponding side plates on the mounting plate in parallel, and the connecting lines of the opposite two movable connecting positions between the base plate and the mounting plate are mutually rotated at an angle.
  9. 9. The mango anthracnose detection device according to claim 5, further comprising a display screen (17) and PWM regulation driving board modules which are respectively in one-to-one correspondence with the halogen lamp light sources (7), wherein the embedded development boards (14) are respectively connected with the corresponding halogen lamp light sources (7) through the PWM regulation driving board modules to realize PWM modulation control on brightness, the display screen (17) is arranged on the outer surface of the box body (1) and is in butt joint with the embedded development boards (14) for displaying output information of the embedded development boards (14), the power supply (4) comprises a main power supply conditioning module, a first voltage conversion system and a second voltage conversion system, the main power supply conditioning module is used for being externally connected with a 15V power supply and sequentially executing filter processing and safety protection, the output ends of the power supply conditioning module are divided into three ends, one output end of the embedded development boards (14) are respectively connected with the input ends of the first voltage conversion system and the input ends of the second voltage conversion system, the first voltage conversion system and the second voltage conversion system are respectively connected with the input ends of the embedded development boards (14), the first voltage conversion system and the second voltage conversion system are respectively connected with the input ends of the first voltage conversion system, the second voltage conversion system is used for carrying out voltage conversion on the received optimized 15V voltage, the corresponding to the received 15V voltage conversion system is carried out by the first voltage conversion system, the second voltage conversion system is carried out corresponding to the second voltage conversion system, and the second voltage conversion system is used for obtaining the voltage conversion 15 voltage, and the corresponding voltage conversion 5 voltage.

Description

Mango anthracnose detection method and device Technical Field The invention relates to a mango anthracnose detection method and device, and belongs to the technical field of fruit quality detection devices. Background Mango anthracnose is an important disease after mango harvest, and the yield and quality of mango are seriously affected by the bacteria. Along with the continuous improvement of the living standard of people, the requirements of people on mango quality are also improved. Therefore, it is necessary to monitor the quality of the mangoes. At present, fruit screening and grading are mainstream manually, which inevitably leads to the defects of time and labor waste, low accuracy and the like. The existing fruit detection instrument mainly researches the maturity and internal quality of fruits such as sugar content, water content and the like, is not related to an instrument for detecting anthracnose, and most of the existing experiments for detecting anthracnose of mangoes are carried out in a laboratory or are manually detected, wherein the laboratory detection method is long in period, high in cost and high in operation threshold, and the manual detection method is low in efficiency, high in subjectivity and easy to cause unstable detection results due to visual fatigue. Disclosure of Invention The invention aims to solve the technical problem of providing a mango anthracnose detection method, which is used for constructing a mango anthracnose identification model by means of innovative network structure design and efficiently realizing mango anthracnose identification. The invention designs a mango anthracnose detection method, and executes the following steps A to C to obtain a mango anthracnose identification model, and then applies the mango anthracnose identification model to realize anthracnose area identification aiming at a target mango multispectral image; Step A, acquiring a preset number of mango multispectral sample images, wherein each mango multispectral sample image is respectively synthesized by shooting images of corresponding preset channels of mangoes, and the anthrax disease area in each mango multispectral sample image is known, so that a single sample is formed by a single mango multispectral sample image to obtain a sample set, and then the step B is counted; Step B, based on the feature extraction sub-network introducing CBAM attention mechanism, connecting the classification sub-networks in series, constructing a network to be trained, and entering the step C; Step C, based on a sample set, taking a mango multispectral sample image in the sample as input, taking an anthracnose disease area in the mango multispectral sample image as output, and training a network to be trained to obtain a mango anthracnose recognition model; The characteristic extraction sub-network of the CBAM attention mechanism introduced in the step B comprises at least two convolution processing units which are sequentially connected in series from an input end to an output end, wherein the input end of the first convolution processing unit in sequence forms the input end of the characteristic extraction sub-network, namely the input end of the network to be trained, and the output end of the last convolution processing unit in sequence forms the output end of the characteristic extraction sub-network; The convolution processing units respectively comprise a convolution layer, a ReLU activation layer, a CBAM attention layer and a pooling layer which are sequentially connected in series from an input end to an output end, wherein the input end of the convolution layer forms the input end of the convolution processing unit, the output end of the pooling layer forms the output end of the convolution processing unit, the pooling layer in the first convolution processing unit in sequence is the largest pooling layer, and the pooling layer in the last convolution processing unit in sequence is the global average pooling layer; the classifying sub-network comprises a stretching layer, a Dropout layer, a full-connection layer and a Softmax layer which are sequentially connected in series from an input end to an output end, wherein the input end of the stretching layer forms the input end of the classifying sub-network, and the output end of the Softmax layer forms the output end of the classifying sub-network, namely the output end of the network to be trained. In the step A, after each mango multispectral sample image is obtained, respectively carrying out normalization updating on pixel values of each pixel position in the mango multispectral sample image aiming at each mango multispectral sample image, so as to respectively update each mango multispectral sample image; based on the obtained mango anthracnose identification model, carrying out normalization updating on pixel values of each pixel position in the target mango multispectral image, and then applying the mango anthracnose identification model t