A method, system and device for detecting mold growth on tobacco leaf stems
By using image recognition technology to automatically detect the tobacco leaf heads, the problem of early detection of mold during the tobacco curing process has been solved, the detection accuracy has been improved, the number of missed detections has been reduced, and the quality of tobacco leaves has been ensured.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-08-22
- Publication Date
- 2026-06-19
AI Technical Summary
In existing technologies, it is difficult to detect mold growth on the tobacco leaves at the beginning of the curing process, resulting in a high probability of missed detection, missing the period for mold prevention and adjustment, and causing economic losses.
Image recognition technology is used to acquire images of tobacco leaf heads through image acquisition equipment, and then preprocessing, segmenting, extracting target regions, and analyzing mold detection models to achieve automatic detection of mold degree thresholds.
This improved the accuracy of detecting mold on tobacco leaf heads, reduced the probability of missed detection, ensured timely adjustments to the curing process, and avoided economic losses.
Smart Images

Figure CN117095218B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of mold detection technology, and in particular to a method, system and device for detecting mold on tobacco leaf heads. Background Technology
[0002] Currently, tobacco curing has entered the era of intelligent systems. These systems adaptively control environmental parameters such as temperature and humidity, and the speed of circulating fans during the curing process. However, they cannot detect mold growth on the tobacco leaves at the leaf tips during curing. Mold growth on the leaf tips leads to a decline in tobacco grade or even rejection, often resulting in significant economic losses. Currently, it is difficult to observe early-stage mold growth on the leaf tips with the naked eye during the curing process. Existing technologies rely on manual inspection, which has a high probability of missing the opportunity to adjust and prevent mold growth during the curing process.
[0003] Therefore, how to improve the accuracy of detecting mold on tobacco leaf heads is a technical problem that urgently needs to be solved by those skilled in the art. Summary of the Invention
[0004] To address the aforementioned technical problems, this application provides a method for detecting mold growth on tobacco leaf heads, which improves the accuracy of mold detection. This application also provides a system and apparatus for detecting mold growth on tobacco leaf heads, achieving the same technical effect.
[0005] The first objective of this application is to provide a method for detecting mold growth on tobacco leaf heads.
[0006] The aforementioned objective of this application is achieved through the following technical solution:
[0007] A method for detecting mold growth on tobacco leaf bales includes:
[0008] Acquire images of tobacco leaf heads captured by an image acquisition device;
[0009] The image of the tobacco leaf bundle is preprocessed to obtain a preprocessed image;
[0010] The preprocessed image is segmented to obtain a segmented image;
[0011] The target region is extracted from the segmented image to obtain the target image;
[0012] The target image is input into a pre-trained mold detection model to obtain a mold severity threshold.
[0013] The mold degree threshold is compared with a preset threshold to obtain the mold detection result.
[0014] Preferably, in the method for detecting mold on tobacco leaf heads, the mold detection model is trained through the following steps:
[0015] Acquire sample images of tobacco leaf heads, wherein the sample images of tobacco leaf heads include sample images of heads that have not rotted, sample images of heads that have just rotted, and sample images of heads that have obviously rotted.
[0016] The sample image of the tobacco leaf bundle is preprocessed to obtain a preprocessed sample image;
[0017] The preprocessed sample image is segmented to obtain a segmented sample image;
[0018] The target region is extracted from the segmented sample image to obtain the target sample image;
[0019] A mold detection model is constructed, and the target sample image is used to train the mold detection model to obtain a trained mold detection model.
[0020] Preferably, in the method for detecting mold on tobacco leaf heads, the step of training the mold detection model using the target sample image to obtain a trained mold detection model includes:
[0021] From the target sample image, obtain a first sample image with the same sampling area and adjacent sampling times;
[0022] The first sample image is divided into blocks to obtain block sample images;
[0023] Information is extracted from the segmented sample images to obtain the color information of each segmented sample image;
[0024] The color information of the block sample images with the same block area and adjacent sampling time is compared to obtain the comparison overlap data;
[0025] The mold detection model is trained using the comparison overlap data to obtain a trained mold detection model.
[0026] The color information includes grayscale values, the number of pixels for each grayscale value, and the number of pixels for the RGB three channels.
[0027] Preferably, in the method for detecting mold on tobacco leaf heads, the preprocessing of the tobacco leaf head image to obtain a preprocessed image includes:
[0028] The color information of the tobacco leaf head image is calibrated using a standard colorimetric chart to obtain a calibrated image;
[0029] Based on the calibration image, a preprocessing type is determined, and the calibration image is processed according to the preprocessing type to obtain a preprocessed image;
[0030] The preprocessing types include image shadow type and image noise type. For the image shadow type, homomorphic filtering is used for processing, and for the image noise type, non-maximum suppression is used for processing.
[0031] Accordingly, the preprocessing of the tobacco leaf head sample image to obtain a preprocessed sample image includes:
[0032] The color information of the tobacco leaf sample image is calibrated using a standard colorimetric card to obtain a calibrated sample image.
[0033] Based on the calibration sample image, the preprocessing type is determined, and the calibration sample image is processed according to the preprocessing type to obtain a preprocessed sample image;
[0034] The preprocessing types include image shadow type and image noise type. For the image shadow type, homomorphic filtering is used for processing, and for the image noise type, non-maximum suppression is used for processing.
[0035] Preferably, in the method for detecting mold on tobacco leaf heads, the step of segmenting the preprocessed image to obtain a segmented image includes:
[0036] The preprocessed image is segmented using the k-means clustering algorithm to obtain a mask image of the non-tobacco leaf target region;
[0037] By using a mask, the mask image is combined with the preprocessed image to obtain a segmented image;
[0038] Accordingly, the step of segmenting the preprocessed sample image to obtain a segmented sample image includes:
[0039] The preprocessed sample image is segmented using the k-means clustering algorithm to obtain a mask sample image of the non-tobacco leaf target area;
[0040] By using a mask, the masked sample image is combined with the preprocessed sample image to obtain a segmented sample image.
[0041] Preferably, in the method for detecting mold on tobacco leaf heads, the step of extracting the target region from the segmented image to obtain the target image includes:
[0042] The target image is obtained by extracting the target region from the segmented image using a pre-trained Mob-YOLOv5 deep learning network.
[0043] Accordingly, the step of extracting the target region from the segmented sample image to obtain the target sample image includes:
[0044] Using a pre-trained Mob-YOLOv5 deep learning network, the target region is extracted from the segmented sample image to obtain the target sample image.
[0045] The second objective of this application is to provide a detection system for mold growth on tobacco leaf heads.
[0046] The second objective of this application is achieved through the following technical solution:
[0047] A system for detecting mold growth on tobacco leaf bales, comprising:
[0048] The acquisition unit is used to acquire images of tobacco leaf heads captured by the image acquisition device;
[0049] The processing unit is used to preprocess the tobacco leaf head image to obtain a preprocessed image;
[0050] A segmentation unit is used to segment the preprocessed image to obtain a segmented image;
[0051] The extraction unit is used to extract the target region from the segmented image to obtain the target image;
[0052] The detection unit is used to input the target image into a pre-trained mold detection model to obtain a mold degree threshold.
[0053] The comparison unit is used to compare the mold degree threshold with a preset threshold to obtain the mold detection result.
[0054] The third objective of this application is to provide a device for detecting mold growth on tobacco leaf heads.
[0055] The aforementioned objective three of this application is achieved through the following technical solution:
[0056] A device for detecting mold growth on tobacco leaf bales includes: an image acquisition device and a mold detection device connected to each other, wherein:
[0057] The image acquisition device is used to acquire images of tobacco leaf heads;
[0058] The mold detection device is used to perform any of the methods described above for detecting mold on tobacco leaf heads.
[0059] Preferably, in the tobacco leaf mold detection device, the image acquisition device is arranged inside a tobacco curing barn with a rectangular interior space, and the image acquisition device includes four top-level imaging devices and one bottom-level imaging device, wherein:
[0060] The four top-level shooting devices are respectively installed at any of the four quarter points on the four sides of the top rectangular wall of the tobacco curing barn, excluding the midpoint, and the lines connecting the installation positions of the four top-level shooting devices form a parallelogram with the largest area.
[0061] The bottom-level shooting device is movably mounted on a sliding track arranged on the bottom central axis of the tobacco curing barn.
[0062] Preferably, the device for detecting mold growth on tobacco leaf bales further includes an alarm device connected to the mold detection device and the image acquisition device, wherein:
[0063] The alarm device is used to determine the location of mold occurrence based on the mold detection results output by the mold detection device and the tobacco leaf bundle image acquired by the image acquisition device.
[0064] The alarm device is also used to broadcast the mold detection results and the location of the mold occurrence.
[0065] The above technical solution, based on image recognition technology, detects mold growth on tobacco leaf heads. Specifically, it involves: acquiring an image of the tobacco leaf head from an image acquisition device; preprocessing the image to obtain a preprocessed image; segmenting the preprocessed image to obtain a segmented image; extracting the target region from the segmented image to obtain a target image; inputting the target image into a pre-trained mold detection model to obtain a mold degree threshold; and comparing the mold degree threshold with a preset threshold to obtain the mold detection result. Compared to existing manual inspection methods, this technical solution, by using an image acquisition device to acquire images of tobacco leaf heads and judging the degree of mold growth based on the image features of these images, is not affected by human visual inspection, thus reducing the probability of missed detections. In summary, the above technical solution can improve the accuracy of mold detection on tobacco leaf heads. Attached Figure Description
[0066] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0067] Figure 1 This is a flowchart illustrating a method for detecting mold on tobacco leaf heads in an embodiment of this application.
[0068] Figure 2 This is a schematic diagram of an image segmentation process in an embodiment of this application;
[0069] Figure 3 This is a schematic diagram illustrating the segmentation effect of k-means clustering with different numbers of cluster centers in the embodiments of this application;
[0070] Figure 4 This is a schematic diagram of a mask image in an embodiment of this application;
[0071] Figure 5 This is a schematic diagram of a segmented image according to an embodiment of this application;
[0072] Figure 6 This is a schematic diagram of the structure of a detection system for mold growth on tobacco leaf bales, as described in an embodiment of this application.
[0073] Figure 7 This is a schematic diagram of the structure of a detection device for mold growth on tobacco leaf heads in an embodiment of this application;
[0074] Figure 8 This is a schematic diagram of the installation of an image acquisition device according to an embodiment of this application. Detailed Implementation
[0075] To enable those skilled in the art to better understand the technical solutions in this application, the technical solutions in the embodiments of this application will be clearly and completely described below. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0076] In the embodiments provided in this application, it should be understood that the disclosed methods and systems can be implemented in other ways. The system embodiments described below are merely illustrative. For example, the division of units and modules is only a logical functional division, and in actual implementation, there may be other division methods, such as: multiple units or modules can be combined, or integrated into another system, or some features can be ignored or not executed. In addition, the coupling, direct coupling, or communication connection between the various components shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or modules, and can be electrical, mechanical, or other forms.
[0077] In addition, each functional unit in the various embodiments of this application can be integrated into a single processor, or each unit can be a separate device, or two or more units can be integrated into a single device; each functional unit in the various embodiments of this application can be implemented in hardware or in the form of hardware plus software functional units.
[0078] Those skilled in the art will understand that all or part of the steps of the following method embodiments can be implemented by program instructions and related hardware. The aforementioned program instructions can be stored in a computer-readable storage medium. When the program instructions are executed, they perform the steps of the following method embodiments. The aforementioned storage medium includes various media capable of storing program code, such as mobile storage devices, read-only memory (ROM), magnetic disks, or optical disks.
[0079] It should be understood that the use of terms such as "system," "device," "unit," and / or "module" in this application is merely one method of distinguishing different components, elements, parts, sections, or assemblies at different levels. However, if other terms can achieve the same purpose, they may be replaced by other expressions.
[0080] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of this application, "a plurality of" or "several" means two or more, unless otherwise explicitly specified.
[0081] If a flowchart is used in this application, it is used to illustrate the operations performed by the system according to embodiments of this application. It should be understood that the preceding or following operations are not necessarily performed in exact order. Instead, the steps can be processed in reverse order or simultaneously. Furthermore, other operations can be added to these processes, or one or more steps can be removed from them.
[0082] It should also be noted that, in this document, terms such as “comprising,” “including,” or any other variations thereof are intended to cover non-exclusive inclusion, such that an article or device that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such an article or device. Without further limitation, an element defined by the phrase “comprising one…” does not exclude the presence of other identical elements in the article or device that includes the aforementioned element.
[0083] Tobacco leaf rot is a fungal disease that occurs during the tobacco curing period. The pathogen is *Rhizopus oryzae*, which is widely present in the soil and on living tobacco leaves. As harvested tobacco leaves enter the curing barn, it multiplies rapidly in the high temperature and humidity environment, causing disease in the leaves starting to turn yellow. It is characterized by its rapid spread and severe damage, leading to serious mold growth and losses in both yield and quality during curing. Currently, it is difficult to observe the early stages of mold growth on the tobacco leaf tips with the naked eye during the curing process. Existing technologies rely on manual inspection, which has a high probability of missing the initial detection point and thus making it easy to miss crucial adjustments for mold prevention during curing.
[0084] The embodiments in this application are written in a progressive manner.
[0085] like Figure 1 As shown in the embodiment of this application, a method for detecting mold on tobacco leaf heads is provided, comprising:
[0086] S101. Acquire an image of the tobacco leaf bundle captured by the image acquisition device;
[0087] In S101, the image acquisition device can be a camera or other shooting device, which can be installed in the tobacco curing barn to collect images of the tobacco leaves. The image acquisition device performs on-site image sampling in the actual curing area. The number of images collected and the time interval between collections during each curing process of tobacco leaves can be determined according to the actual application requirements. This application does not impose any restrictions on this.
[0088] S102. Preprocess the image of the tobacco leaf head to obtain a preprocessed image;
[0089] In S102, in order to improve the image quality, the tobacco leaf head image is preprocessed to obtain a preprocessed image. Specifically, different methods can be used for preprocessing according to the influencing factors such as equipment and environment on the tobacco leaf head image. For example, the preprocessing process may include image color correction, image contrast adjustment, image denoising, etc., but this application is not limited to these.
[0090] S103. Perform segmentation processing on the preprocessed image to obtain a segmented image;
[0091] In S103, in order to better distinguish between the tobacco leaf region and the background region in the preprocessed image, the preprocessed image is segmented to obtain a segmented image. Specifically, existing image segmentation methods can be used, such as segmenting the preprocessed image based on the k-means clustering algorithm to obtain a segmented image.
[0092] S104. Extract the target region from the segmented image to obtain the target image;
[0093] In S104, in order to better identify the tobacco leaf head region in the segmented image, the target region is extracted from the segmented image to obtain the target image. Specifically, a pre-trained target detection network can be used, for example, a trained YOLOv5 target detection network can be used to extract the tobacco leaf head region in the segmented image to obtain the target image.
[0094] S105. Input the target image into the pre-trained mold detection model to obtain the mold degree threshold;
[0095] In S105, the target image is input into the pre-trained mold detection model. The mold detection model analyzes and processes the target image and outputs a mold degree threshold reflecting the degree of mold on the tobacco leaves. Specifically, a mold detection model can be pre-created, and sample images of tobacco leaves with different degrees of mold can be collected. After applying the same processing steps as in S102-S104 to the sample images of the tobacco leaves, the target sample image is obtained. Then, the mold detection model is trained using the target sample image, so that the mold detection model outputs a mold degree threshold reflecting different degrees of mold, thereby obtaining a trained mold detection model.
[0096] S106. Compare the mold degree threshold with the preset threshold to obtain the mold detection result.
[0097] In step S106, the mold severity threshold is compared with a preset threshold to obtain the mold detection result of the currently acquired tobacco leaf head image. Specifically, the preset threshold can be set according to actual application requirements. For example, if the mold severity threshold is higher than the first preset threshold, the mold detection result is no mold; if the mold severity threshold is lower than or equal to the first preset threshold but higher than the second preset threshold, the mold detection result is that mold has just occurred; if the mold severity threshold is lower than or equal to the second preset threshold, the mold detection result is that mold has occurred and the mold depth is increased. Other comparison methods can also be reasonably used for the mold severity threshold and the preset threshold, and this application is not limited to these.
[0098] The above embodiment uses image recognition technology to detect mold growth on tobacco leaf heads. Specifically, it involves: acquiring an image of the tobacco leaf head from an image acquisition device; preprocessing the image to obtain a preprocessed image; segmenting the preprocessed image to obtain a segmented image; extracting the target region from the segmented image to obtain a target image; inputting the target image into a pre-trained mold detection model to obtain a mold degree threshold; and comparing the mold degree threshold with a preset threshold to obtain the mold detection result. Compared to existing manual inspection methods, this embodiment uses an image acquisition device to acquire images of tobacco leaf heads and judges the degree of mold growth based on the image features of these images. This is not affected by human visual inspection and reduces the probability of missed detections. In summary, the above embodiment can improve the accuracy of mold detection on tobacco leaf heads.
[0099] In other embodiments of this application, the mold detection model is trained through the following steps:
[0100] S201. Obtain sample images of tobacco leaf heads, including sample images of tobacco leaf heads that have not rotted, sample images of tobacco leaf heads that have just rotted, and sample images of tobacco leaf heads that have obviously rotted.
[0101] In S201, the tobacco leaf head sample images can be acquired by an image acquisition device. The number of sample images acquired and the acquisition time interval can be determined according to actual application requirements, and this application does not impose any restrictions on this. Based on different degrees of mold growth in the tobacco leaves, the tobacco leaf head sample images can be classified into images of tobacco leaves that have not yet rotted, images of tobacco leaves that have just begun to rot, and images of tobacco leaves that have clearly rotted. The classification method can be pre-classified manually or by other reasonable classification methods, and this application does not impose any restrictions on this.
[0102] S202. Preprocess the sample image of the tobacco leaf head to obtain a preprocessed sample image;
[0103] S203. Perform segmentation processing on the preprocessed sample image to obtain a segmented sample image;
[0104] S204. Extract the target region from the segmented sample image to obtain the target sample image;
[0105] For specific implementation details of S202-S204, please refer to S102-S104 above.
[0106] S205. Construct a mold detection model and train the mold detection model using target sample images to obtain a trained mold detection model.
[0107] In step S205, specifically, the mold detection model can be trained using the target sample image, so that the mold detection model outputs a threshold reflecting different degrees of mold, namely, a threshold reflecting the degree of mold in samples with no rotten ends, samples with just begun to rot, and samples with obvious rot, thereby obtaining a trained mold detection model. In other embodiments, one implementation of the step of training the mold detection model using the target sample image to obtain a trained mold detection model includes:
[0108] S2051. Obtain the first sample image with the same sampling area and adjacent sampling times from the target sample image;
[0109] In S2051, in order to obtain a sample that can better reflect the moldy condition of tobacco leaves, a first sample image with the same sampling area and adjacent sampling time is further obtained from the target image sample. Specifically, the same sampling area can be the same location area where the same image acquisition device collects sample images in the actual baking area. The sample images with adjacent sampling time can be sample images continuously collected by the image acquisition device in the actual baking area according to a preset sampling period.
[0110] S2052. Divide the first sample image into blocks to obtain block sample images;
[0111] In S2052, the first sample image can be divided into blocks according to a preset segmentation ratio to obtain block sample images, for example, referring to... Figure 2 As shown, each first sample image (such as...) can be processed. Figure 2 The image shown in (a) before image segmentation is divided into 3×3 segments, resulting in 9 segmented sample images. Furthermore, each segmented sample image can be labeled according to its segmented region (e.g., ...). Figure 2 (b) Images numbered 1-9 after the image is divided into blocks.
[0112] S2053. Extract information from the segmented sample images to obtain the color information of each segmented sample image, wherein the color information includes grayscale value, number of pixels for each grayscale value, and number of pixels for the RGB three channels.
[0113] In S2053, in order to obtain mold characteristics that can better reflect the mold situation of tobacco leaves, information is extracted from the block sample images to obtain the color information of each block sample image. Based on the extracted color information, the small and slowly changing mold characteristics of the tobacco leaf head can be accurately reflected.
[0114] S2054. Compare the color information of block sample images with the same block area and adjacent sampling time to obtain the comparison overlap data;
[0115] In S2054, the color information of multiple block sample images with adjacent sampling times and located in the same block area is compared separately to obtain comparison overlap data. For example, by comparing the color information of two block sample images with adjacent sampling times and located in the same block area, a large amount of comparison overlap data can be obtained. The color information comparison can be performed using a histogram method, or other comparison methods can be reasonably adopted.
[0116] S2055. The mold detection model is trained using the comparison overlap data to obtain a trained mold detection model;
[0117] In S2055, the mold detection model is trained using comparison overlap data, enabling the mold detection model to identify small and slowly changing mold features on the tobacco leaf heads based on the comparison overlap data, and output mold degree thresholds reflecting different degrees of mold, thus obtaining a well-trained mold detection model.
[0118] Through the above implementation steps, the color information of the sample images is compared to obtain the comparison overlap data to train the mold detection model. This can effectively solve the problem of image recognition technology's difficulty in detecting small and slowly changing targets, and can improve the accuracy of mold detection in tobacco leaf heads.
[0119] In other embodiments of this application, one implementation of the step of preprocessing the tobacco leaf head image to obtain a preprocessed image includes:
[0120] S301. The color information of the tobacco leaf head image is calibrated using a standard colorimetric card to obtain a calibrated image;
[0121] Specifically, in S301, a standard colorimetric card can be placed in the shooting area of the image acquisition device, and the color information of the tobacco leaf head image can be calibrated by the standard colorimetric card to obtain a calibrated image.
[0122] S302. Based on the calibration image, determine the preprocessing type, and process the calibration image according to the preprocessing type to obtain a preprocessed image;
[0123] In S302, the preprocessing type can be determined based on the calibration image. Specifically, the preprocessing type includes image shadow type and image noise type. For images with image shadow type, which may be affected by illumination intensity, resulting in excessively large shadow areas, homomorphic filtering can be used for processing. Homomorphic filtering utilizes the removal of multiplicative noise to simultaneously increase contrast and normalize brightness, thereby achieving image enhancement. For images with image noise type, which have excessively large noise points, non-maximum suppression can be used for processing. Non-maximum suppression helps suppress all gradient values except for local maxima, indicating the location with the strongest intensity value change.
[0124] The preprocessing process described above yields a preprocessed image, which improves image quality and enhances the accuracy of detecting mold growth on tobacco leaf heads.
[0125] In other embodiments of this application, one implementation of the step of preprocessing the tobacco leaf head sample image to obtain a preprocessed sample image includes:
[0126] S303. The color information of the tobacco leaf head sample image is calibrated using a standard colorimetric card to obtain a calibrated sample image;
[0127] S304. Based on the calibration sample image, determine the preprocessing type, and process the calibration sample image according to the preprocessing type to obtain a preprocessed sample image; wherein, the preprocessing type includes image shadow type and image noise type. For the image shadow type, the homomorphic filtering method is used for processing, and for the image noise type, the non-maximum suppression method is used for processing.
[0128] For details on the implementation of S303 and S304, please refer to S301 and S302 above.
[0129] In other embodiments of this application, the preprocessed image is segmented to obtain a segmented image, including:
[0130] S401. Use the k-means clustering algorithm to segment the preprocessed image to obtain a mask image of the non-tobacco leaf target area;
[0131] In S401, the k-means clustering algorithm, also known as the k-means clustering algorithm, is an iterative clustering analysis algorithm. Its steps are as follows: First, the data is pre-divided into K groups. Then, K objects are randomly selected as initial cluster centers. Next, the distance between each object and each seed cluster center is calculated, and each object is assigned to the nearest cluster center. Each cluster center and the objects assigned to it represent a cluster. Each time a sample is assigned, the cluster centers are recalculated based on the existing objects in the cluster. This process is repeated until a termination condition is met. The termination condition can be that no (or a minimum number) objects are reassigned to different clusters, no (or a minimum number) cluster centers change, or the sum of squared errors reaches a local minimum. In specific implementations, the number of cluster centers can be determined according to actual application requirements. For example, you can refer to the segmentation effect diagrams using different numbers of cluster centers in k-means clustering. Figure 3 The resulting mask image of the non-tobacco leaf target area can be used as a reference. Figure 4 .
[0132] S402. Using a mask, combine the mask image with the preprocessed image to obtain a segmented image;
[0133] In S402, a mask can be used to occlude (fully or partially) the image being processed using a selected image, thereby controlling the area or process of image processing. Specifically, a mask can be used to replace non-tobacco target areas in the preprocessed image with the mask image to obtain a segmented image. (See reference...) Figure 5 .
[0134] Through the above image segmentation process, the final segmented image can be better distinguished from the tobacco leaf area and background area in the preprocessed image, which is beneficial to improving the accuracy of detecting mold on tobacco leaf heads.
[0135] In other embodiments of this application, one implementation of the step of segmenting the preprocessed sample image to obtain a segmented sample image includes:
[0136] S403. Use the k-means clustering algorithm to segment the preprocessed sample image to obtain a mask sample image of the non-tobacco target area;
[0137] S403. Using a mask, combine the mask sample image with the preprocessed sample image to obtain a segmented sample image.
[0138] For details on the implementation of S403 and S404, please refer to S401 and S402 above.
[0139] In other embodiments of this application, one implementation of the step of extracting the target region from the segmented image to obtain the target image includes:
[0140] S501. Using a pre-trained Mob-YOLOv5 deep learning network, the target region is extracted from the segmented image to obtain the target image;
[0141] In the S501, the Mob-YOLOv5 deep learning network can be trained through the following steps: Labeling the tobacco leaf targets using `labelimg` yields a usable dataset. This dataset is then fed into the Mob-YOLOv5 deep learning network, employing a freeze-training method. During the freeze phase, the backbone network of the model is frozen, and only fine-tuning is performed. Freeze-training is set to 50 generations, followed by 100 generations of unfreezing training. Weights are saved every 5 training iterations, and the optimal weights are obtained after training. Using the pre-trained Mob-YOLOv5 deep learning network, the region containing the tobacco leaf heads in the image can be identified and extracted to obtain the target image.
[0142] Through the above target region extraction process, the target image is finally obtained, which can better identify and extract the tobacco leaf head region in the segmented image, thus improving the accuracy of tobacco leaf head mold detection.
[0143] In other embodiments of this application, one implementation of the step of extracting the target region from the segmented sample image to obtain the target sample image includes:
[0144] S502. Using a pre-trained Mob-YOLOv5 deep learning network, target regions are extracted from segmented sample images to obtain target sample images.
[0145] For details on the specific implementation of S502, please refer to S501 above.
[0146] like Figure 6 As shown, in another embodiment of this application, a detection system for mold growth on tobacco leaf bales is also provided, comprising:
[0147] Acquisition unit 10 is used to acquire images of tobacco leaf heads captured by the image acquisition device;
[0148] Processing unit 11 is used to preprocess the tobacco leaf head image to obtain a preprocessed image;
[0149] Segmentation unit 12 is used to segment the preprocessed image to obtain a segmented image;
[0150] Extraction unit 13 is used to extract the target region from the segmented image to obtain the target image;
[0151] Detection unit 14 is used to input the target image into a pre-trained mold detection model to obtain a mold degree threshold.
[0152] The comparison unit 15 is used to compare the mold degree threshold with the preset threshold to obtain the mold detection result.
[0153] In other embodiments of this application, the detection system for mold growth on tobacco leaf heads further includes a training unit, wherein the training unit is used to train a mold detection model, and the training unit specifically includes:
[0154] The acquisition module is used to acquire sample images of tobacco leaf heads, including sample images of tobacco leaf heads that have not rotted, sample images of tobacco leaf heads that have just rotted, and sample images of tobacco leaf heads that have obviously rotted.
[0155] The processing module is used to preprocess the tobacco leaf head sample image to obtain a preprocessed sample image;
[0156] The segmentation module is used to segment the preprocessed sample image to obtain a segmented sample image;
[0157] The extraction module is used to extract the target region from the segmented sample image to obtain the target sample image;
[0158] The training module is used to build a mold detection model and train the mold detection model using target sample images to obtain a trained mold detection model.
[0159] In other embodiments of this application, when the training module trains the mold detection model using target sample images to obtain a trained mold detection model, it is specifically used for:
[0160] From the target sample image, obtain the first sample image with the same sampling area and adjacent sampling times;
[0161] The first sample image is divided into blocks to obtain block sample images;
[0162] Information is extracted from the segmented sample images to obtain the color information of each segmented sample image;
[0163] The color information of block sample images with the same segmented region and adjacent sampling time is compared to obtain the comparison overlap data;
[0164] By comparing the overlap data, the mold detection model is trained to obtain a well-trained mold detection model.
[0165] The color information includes grayscale values, the number of pixels for each grayscale value, and the number of pixels for the RGB three channels.
[0166] In other embodiments of this application, when processing unit 11 performs preprocessing on the tobacco leaf head image to obtain a preprocessed image, it is specifically used for:
[0167] The color information of the tobacco leaf head image is calibrated using a standard colorimetric card to obtain a calibrated image;
[0168] Based on the calibration image, determine the preprocessing type, and process the calibration image according to the preprocessing type to obtain the preprocessed image;
[0169] The preprocessing types include image shadow type and image noise type. For image shadow type images, homomorphic filtering is used for processing, and for image noise type images, non-maximum suppression is used for processing.
[0170] In other embodiments of this application, when the processing module performs preprocessing on the tobacco leaf head sample image to obtain a preprocessed sample image, it is specifically used for:
[0171] The color information of the tobacco leaf head sample image is calibrated using a standard colorimetric card to obtain a calibrated sample image.
[0172] Based on the calibration sample image, determine the preprocessing type, and process the calibration sample image according to the preprocessing type to obtain the preprocessed sample image;
[0173] The preprocessing types include image shadow type and image noise type. For image shadow type images, homomorphic filtering is used for processing, and for image noise type images, non-maximum suppression is used for processing.
[0174] In other embodiments of this application, when the segmentation unit 12 performs segmentation processing on the preprocessed image to obtain a segmented image, it is specifically used for:
[0175] The k-means clustering algorithm is used to segment the preprocessed image to obtain a mask image of the non-tobacco leaf target area;
[0176] By using a mask, the mask image is combined with the preprocessed image to obtain a segmented image.
[0177] In other embodiments of this application, when the segmentation module performs segmentation processing on the preprocessed sample image to obtain a segmented sample image, it is specifically used for:
[0178] The k-means clustering algorithm is used to segment the preprocessed sample images to obtain mask sample images of non-tobacco leaf target areas;
[0179] By using a mask, the masked sample image is combined with the preprocessed sample image to obtain a segmented sample image.
[0180] In other embodiments of this application, when the extraction unit 13 performs target region extraction on the segmented image to obtain the target image, it is specifically used for:
[0181] Using a pre-trained Mob-YOLOv5 deep learning network, the target region is extracted from the segmented image to obtain the target image.
[0182] In other embodiments of this application, when the extraction module performs target region extraction on the segmented sample image to obtain the target sample image, it is specifically used for:
[0183] Using a pre-trained Mob-YOLOv5 deep learning network, the target region is extracted from the segmented sample image to obtain the target sample image.
[0184] like Figure 7 As shown, in another embodiment of this application, a device for detecting mold growth on tobacco leaf heads is also provided, comprising: an image acquisition device 20 and a mold detection device 21 connected to each other, wherein:
[0185] Image acquisition device 20 is used to acquire images of tobacco leaf heads;
[0186] The mold detection device 21 is used to perform any of the methods described above for detecting mold on tobacco leaf heads.
[0187] The image acquisition device 20 can be a camera or other imaging device, which can be installed in the tobacco curing barn to capture images of tobacco leaf heads. The mold detection device 21 can acquire the tobacco leaf head images captured by the image acquisition device 20 and obtain the mold detection result based on any of the above-described methods for detecting mold on tobacco leaf heads. This embodiment can improve the accuracy of mold detection on tobacco leaf heads.
[0188] In other embodiments of this application, the image acquisition device 20 is arranged inside a tobacco curing barn with a rectangular interior space. The image acquisition device 20 includes four top-level imaging devices and one bottom-level imaging device, wherein:
[0189] Four top-level camera devices are installed at any of the four quarter points on the four sides of the rectangular wall at the top of the tobacco curing barn, excluding the midpoint, and the lines connecting the installation positions of the four top-level camera devices form the largest possible parallelogram. The bottom-level camera devices are movably installed on a sliding track arranged on the central axis at the bottom of the tobacco curing barn.
[0190] Specifically, with Figure 8 Taking the installation diagram shown as an example, the middle layer of the tobacco curing barn is the tobacco loading layer, and the image acquisition device 20 is used to acquire images of the tobacco leaf heads placed on the tobacco loading layer; the image acquisition device 20 has four top-level shooting devices (such as...) Figure 8 (201, 202, 203, 204 in the image), top-level camera devices 202 and 203 are installed on the top wall in the front-back direction near the diagonal corner (e.g., ...). Figure 8 At a distance of 1 / 4 from positions A and B, top-level camera devices 201 and 204 are installed on the top wall in the left-right direction, close to the aforementioned diagonal (e.g., ...). Figure 8 At a distance of 3 / 4 from positions A and B, that is, at any of the four quarter points (excluding the midpoint) on the four sides of the rectangular wall at the top of the tobacco curing barn, the four top-level imaging devices are respectively installed, and the lines connecting the installation positions of the four top-level imaging devices form a parallelogram with the largest possible area. One bottom-level imaging device 205 of the image acquisition device 20 is movably mounted on a sliding track on the central axis at the bottom of the tobacco curing barn. In other embodiments, the shooting angle of each imaging device and the position of the bottom-level imaging device 205 on the sliding track can also be remotely adjusted.
[0191] Based on the above-mentioned image acquisition device 20, the real-time detection of the rotten tobacco leaves during the curing process in a closed environment is realized around the clock without any blind spots, avoiding the shortcomings of not being able to observe or adjust during the curing process.
[0192] In other embodiments of this application, the tobacco leaf bale mold detection device further includes an alarm device connected to the mold detection device 21 and the image acquisition device 20, wherein:
[0193] An alarm device is used to determine the location of mold occurrence based on the mold detection results output by the mold detection device 21 and the tobacco leaf bundle image acquired by the image acquisition device 20.
[0194] The alarm device is also used to broadcast the results of mold detection and the location of mold occurrence.
[0195] Specifically, after confirming that mold has occurred on the tobacco leaf heads based on the mold detection results output by the mold detection device 21, the alarm device can combine the location in the image acquired by the image acquisition device 20 with the actual geographical and spatial location to obtain the accurate real-world location of the mold. For the moldy area in the image acquired by the image acquisition device 20, a coordinate system is established to display the specific mold location. Specifically, three coordinate systems can be constructed and transformed: the world coordinate system, the coordinate system of the image acquisition device 20, and the image coordinate system. Then, the image acquisition device 20 is calibrated to obtain the coordinates of the new projection point of the three-dimensional point on the image. This determines the three-dimensional geometric position of a point in the horizontal layer of the tobacco curing barn and its corresponding point in the image, thereby determining the location of the mold after coordinate transformation. The alarm device can announce the mold detection results and the location of the mold through voice broadcast to remind staff to adjust the tobacco curing process, providing more accurate guidance for the tobacco curing process.
[0196] The above description of the disclosed embodiments enables those skilled in the art to make or use this application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of this application. Therefore, this application is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A method for detecting mold on tobacco leaf bales, characterized in that, include: Acquire images of tobacco leaf heads captured by an image acquisition device; The image of the tobacco leaf bundle is preprocessed to obtain a preprocessed image; The preprocessed image is segmented to obtain a segmented image; The target region is extracted from the segmented image to obtain the target image; The target image is input into a pre-trained mold detection model to obtain a mold severity threshold. The mold severity threshold is compared with a preset threshold to obtain the mold detection result; The mold detection model is trained through the following steps: Acquire sample images of tobacco leaf heads, wherein the sample images of tobacco leaf heads include sample images of heads that have not rotted, sample images of heads that have just rotted, and sample images of heads that have obviously rotted. The sample image of the tobacco leaf bundle is preprocessed to obtain a preprocessed sample image; The preprocessed sample image is segmented to obtain a segmented sample image; The target region is extracted from the segmented sample image to obtain the target sample image; A mold detection model is constructed, and the mold detection model is trained using the target sample image to obtain a trained mold detection model; The step of training the mold detection model using the target sample image to obtain a trained mold detection model includes: From the target sample image, obtain a first sample image with the same sampling area and adjacent sampling times; The first sample image is divided into blocks to obtain block sample images; Information is extracted from the segmented sample images to obtain the color information of each segmented sample image; The color information of the block sample images with the same block area and adjacent sampling time is compared to obtain the comparison overlap data; The mold detection model is trained using the comparison overlap data to obtain a trained mold detection model. The color information includes grayscale values, the number of pixels for each grayscale value, and the number of pixels for the RGB three channels.
2. The method as claimed in claim 1, characterized in that, The preprocessing of the tobacco leaf head image to obtain a preprocessed image includes: The color information of the tobacco leaf head image is calibrated using a standard colorimetric chart to obtain a calibrated image; Based on the calibration image, a preprocessing type is determined, and the calibration image is processed according to the preprocessing type to obtain a preprocessed image; The preprocessing types include image shadow type and image noise type. For the image shadow type, homomorphic filtering is used for processing, and for the image noise type, non-maximum suppression is used for processing. Accordingly, the preprocessing of the tobacco leaf head sample image to obtain a preprocessed sample image includes: The color information of the tobacco leaf sample image is calibrated using a standard colorimetric card to obtain a calibrated sample image. Based on the calibration sample image, the preprocessing type is determined, and the calibration sample image is processed according to the preprocessing type to obtain a preprocessed sample image; The preprocessing types include image shadow type and image noise type. For the image shadow type, homomorphic filtering is used for processing, and for the image noise type, non-maximum suppression is used for processing.
3. The method as claimed in claim 1, wherein, The step of segmenting the preprocessed image to obtain a segmented image includes: The preprocessed image is segmented using the k-means clustering algorithm to obtain a mask image of the non-tobacco leaf target region; By using a mask, the mask image is combined with the preprocessed image to obtain a segmented image; Accordingly, the step of segmenting the preprocessed sample image to obtain a segmented sample image includes: The preprocessed sample image is segmented using the k-means clustering algorithm to obtain a mask sample image of the non-tobacco leaf target area; By using a mask, the masked sample image is combined with the preprocessed sample image to obtain a segmented sample image.
4. The method as claimed in claim 1, wherein, The step of extracting the target region from the segmented image to obtain the target image includes: The target image is obtained by extracting the target region from the segmented image using a pre-trained Mob-YOLOv5 deep learning network. Accordingly, the step of extracting the target region from the segmented sample image to obtain the target sample image includes: Using a pre-trained Mob-YOLOv5 deep learning network, the target region is extracted from the segmented sample image to obtain the target sample image.
5. A detection system for mold growth on tobacco leaf bales, characterized in that, include: The acquisition unit is used to acquire images of tobacco leaf heads captured by the image acquisition device; The processing unit is used to preprocess the tobacco leaf head image to obtain a preprocessed image; A segmentation unit is used to segment the preprocessed image to obtain a segmented image; The extraction unit is used to extract the target region from the segmented image to obtain the target image; The detection unit is used to input the target image into a pre-trained mold detection model to obtain a mold degree threshold. The comparison unit is used to compare the mold degree threshold with a preset threshold to obtain the mold detection result; A training unit is used to train the mold detection model, and the training unit specifically includes: The acquisition module is used to acquire sample images of tobacco leaf heads, wherein the sample images of tobacco leaf heads include sample images of heads that have not rotted, sample images of heads that have just rotted, and sample images of heads that have obviously rotted. The processing module is used to preprocess the tobacco leaf head sample image to obtain a preprocessed sample image; The segmentation module is used to segment the preprocessed sample image to obtain a segmented sample image. The extraction module is used to extract the target region from the segmented sample image to obtain the target sample image; The training module is used to construct a mold detection model and train the mold detection model using the target sample image to obtain a trained mold detection model. The training module, when performing the step of training the mold detection model using the target sample image to obtain the trained mold detection model, is specifically used for: From the target sample image, obtain a first sample image with the same sampling area and adjacent sampling times; The first sample image is divided into blocks to obtain block sample images; Information is extracted from the segmented sample images to obtain the color information of each segmented sample image; The color information of the block sample images with the same block area and adjacent sampling time is compared to obtain the comparison overlap data; The mold detection model is trained using the comparison overlap data to obtain a trained mold detection model. The color information includes grayscale values, the number of pixels for each grayscale value, and the number of pixels for the RGB three channels.
6. A device for detecting mold growth on the head of a tobacco leaf, comprising: include: Interconnected image acquisition devices and mold detection devices, wherein: The image acquisition device is used to acquire images of tobacco leaf heads; The mold detection device is used to perform the method as described in any one of claims 1 to 4.
7. The apparatus of claim 6, wherein The image acquisition equipment is arranged inside a tobacco curing barn, which has a rectangular interior space. The image acquisition equipment includes four top-level imaging devices and one bottom-level imaging device, wherein: The four top-level shooting devices are respectively installed at any of the four quarter points on the four sides of the top rectangular wall of the tobacco curing barn, excluding the midpoint, and the lines connecting the installation positions of the four top-level shooting devices form a parallelogram with the largest area. The bottom-level shooting device is movably mounted on a sliding track arranged on the bottom central axis of the tobacco curing barn.
8. The apparatus as described in claim 7, characterized in that, It also includes an alarm device connected to the mold detection device and the image acquisition device, wherein: The alarm device is used to determine the location of mold occurrence based on the mold detection results output by the mold detection device and the tobacco leaf bundle image acquired by the image acquisition device. The alarm device is also used to broadcast the mold detection results and the location of the mold occurrence.
Citation Information
Patent Citations
Tobacco leaf tip abnormity detection method and device in tobacco leaf curing process
CN112926648A
Method and device for detecting mildewed impurities before tobacco bale slicing
CN115578371A