A fermentation detection method and device based on classification regression
Through the fermentation detection method based on classification and regression, image processing technology is used to automatically identify the angle of the fermentation tank detection window, which solves the problem of low efficiency of manual angle adjustment and achieves efficient and accurate detection of fermentation broth substance concentration.
Patent Information
- Application Number
- CN202410235798.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-03-01
- Publication Date
- 2024-09-10
- Estimated Expiration
- 2044-03-01
AI Technical Summary
In the existing technology, the detection of substance concentration in the fermentation tank relies on manual adjustment of the angle of the near-infrared equipment, which has low efficiency and large errors, resulting in low detection efficiency and accuracy.
A fermentation detection method based on classification regression is adopted, and the image acquisition component is used to obtain the image data of the fermentation tank detection window, and the pre-trained angle classification model, angle regression model and instance segmentation model are used to automatically identify and adjust the angle of the near-infrared equipment to reduce manual intervention. , improve detection accuracy and efficiency.
By automatically identifying the angle of the detection window, the number of angle adjustments of the near-infrared equipment is reduced, the efficiency and accuracy of fermentation detection are improved, the error of manual adjustment is reduced, and the detection efficiency is improved.
Smart Images

Figure CN118133234B
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of mechanical equipment, and in particular to a fermentation detection method and device based on classification regression. Background Art
[0002] In the process of biopharmaceuticals, the concentration of substances in the fermentation broth determines the effect of the medicine. Too high or too low concentration of substances in the fermentation broth can easily cause a great impact on the biopharmaceutical process. Therefore, the detection of substance concentration in the fermentation broth has become an indispensable part of the biopharmaceutical process.
[0003] With the development of science and technology, in order to facilitate the control of fermentation conditions and production, the fermentation process of biopharmaceuticals usually has an independent workshop, and the fermentation liquid is packaged in a large number of giant fermentation tanks. During the fermentation process, it is usually necessary to use near-infrared detection equipment every two hours to detect the concentration of substances in the fermentation liquid through the detection window at the bottom of the fermentation tank, so as to replenish the fermentation substances in time and ensure the fermentation quality.
[0004] In the prior art, due to the different fermentation tank manufacturers, the angles of the detection windows set on the fermentation tanks are also different. When workers inspect each fermentation tank in the factory, they need to constantly adjust the angle of the rotating near-infrared device so that it fits closely with the detection windows of different fermentation tanks, and then detect the concentration of the fermentation liquid in the fermentation tank through the detection window.
[0005] At present, the method for detecting the concentration of substances in the fermentation tanks in the fermentation workshop is still mainly manual, with workers holding near-infrared detection equipment to detect the concentration of substances in the fermentation liquid one by one. During the detection, the worker needs to adjust the angle of the near-infrared detection equipment to align with the angle of the detection window so that the window and the detection equipment fit closely. When adjusting the angle of the detection equipment, not only does the naked eye need to be used to judge the angle of the window, but the angle of the equipment also needs to be manually adjusted to finally fit the equipment and the window. This testing method consumes manpower and material resources and leads to low fermentation detection efficiency. Summary of the invention
[0006] In order to solve the above technical problems, the present invention discloses a fermentation detection method and device based on classification regression, which are used to improve the efficiency and accuracy of angle recognition of fermentation tank detection window, thereby improving the efficiency of fermentation detection.
[0007] In order to achieve the above-mentioned object, in a first aspect, the present invention discloses a fermentation detection method based on classification regression, which is applicable to a fermentation detection machine, wherein the fermentation detection machine comprises an image acquisition component and a near infrared detection device; the fermentation detection method comprises:
[0008] Control the image acquisition component to obtain image data of the detection window of the fermentation tank to be detected, and input the image data into a pre-trained angle classification model, an angle regression model and an instance segmentation model, respectively, to obtain a first window angle, a second window angle and a third window angle corresponding to the detection window;
[0009] Calculate a first absolute value of a difference between the first window angle and the second window angle, a second absolute value of a difference between the first window angle and the third window angle, and a third absolute value of a difference between the second window angle and the third window angle, and compare the first absolute value, the second absolute value, and the third absolute value with a preset absolute value threshold value, respectively;
[0010] When the first absolute value, the second absolute value and the third absolute value are all greater than the absolute value threshold, an abnormal alarm is issued;
[0011] When the first absolute value is greater than the absolute value threshold and the second absolute value or the third absolute value is less than or equal to the absolute value threshold, calculating a first average value of the first window angle and the third window angle or a second average value of the second window angle and the third window angle to obtain a window angle corresponding to the detection window;
[0012] When the first absolute value is less than or equal to the absolute value threshold, a third average value of the first window angle and the second window angle is calculated, and a fourth average value of the first window angle, the second window angle and the third window angle is calculated according to the third average value to obtain a window angle corresponding to the detection window;
[0013] The angle of the near-infrared detection device is adjusted according to the window angle, and the near-infrared detection device is controlled to fit the detection window according to the angle to detect the concentration of the fermentation liquid in the fermentation tank to be detected, so as to obtain the concentration of the fermentation liquid in the fermentation tank to be detected.
[0014] The present invention discloses a fermentation detection method based on classification and regression. First, the image data corresponding to the current detection window are processed respectively by using a pre-trained angle classification model, an angle regression model and an instance segmentation model, and the first window angle, the second window angle and the third window angle are obtained in turn after the angle classification, angle regression and instance segmentation of the current image data, so as to facilitate the subsequent mutual verification of the results obtained by using the angle classification, angle regression and instance segmentation, strictly reduce the angle error, improve the accuracy of the angle of the obtained detection window, thereby reducing the number of angle adjustments of the near-infrared device and improving the efficiency of fermentation detection. Furthermore, after obtaining the different window angles, the error between the angle judgments is strictly limited by comparing the absolute values corresponding to the differences between the two different window angles by using a preset absolute value threshold. At the same time, according to the different results corresponding to the different comparisons, the average values corresponding to the different window angles are calculated as the final window angle, so that the accuracy of the final window angle is very high. The angle of the near-infrared device is adjusted by using the window angle finally obtained after a series of logical judgments, thereby avoiding manual adjustment, reducing the adjustment error and improving the efficiency of fermentation detection.
[0015] As a preferred example, the image acquisition component is controlled to obtain image data of a detection window of the fermentation tank to be detected, and the image data is respectively input into a pre-trained angle classification model, an angle regression model and an instance segmentation model to obtain a first window angle, a second window angle and a third window angle corresponding to the detection window, including:
[0016] Controlling the image acquisition component to acquire an initial color image corresponding to the detection window, and performing denoising processing on the initial color image to obtain image data corresponding to the detection window;
[0017] The image data is input into a pre-trained angle classification model, and the angle of the image data is inferred respectively through different nodes preset in the angle classification model to obtain a plurality of dimensional vectors corresponding to the image data and assign a value to each of the plurality of dimensional vectors; wherein each of the plurality of dimensional vectors corresponds to a different window angle;
[0018] According to the assignment of each dimensional vector in the plurality of dimensional vectors, a first window angle corresponding to the detection window is obtained.
[0019] The present invention sets the angle classification model to perform initial classification of the window angle of the detection window. Specifically, when the image data is input into the classification model, a plurality of dimensional vectors are set in the classification model, and the angles corresponding to the image data are inferred and classified by assigning values to vectors of different dimensions. The first window angle of the classification is verified with the subsequently obtained predicted angle and the angle obtained by instance segmentation, thereby improving the accuracy of window angle recognition.
[0020] As a preferred example, in the step of inputting the image data into a pre-trained angle classification model, an angle regression model, and an instance segmentation model, respectively, to obtain a first window angle, a second window angle, and a third window angle corresponding to the detection window, the step further includes:
[0021] Input the image data into a pre-trained angle regression model, extract image features corresponding to the image data through the angle regression model, predict the angle of the detection window according to the image features, and output the second window angle;
[0022] Inputting the image data into a pre-trained instance segmentation model, performing instance segmentation on the image data through the instance segmentation model, and obtaining a plurality of segmented regions corresponding to the image data;
[0023] Calculating the angles between center points of two adjacent segmented regions in the plurality of segmented regions by using the instance segmentation model to obtain a plurality of segmentation angles corresponding to the image data;
[0024] The third window angle is obtained by calculating the average values corresponding to the plurality of segmentation angles through the instance segmentation model.
[0025] The present invention sets the angle regression model to extract features from image data and predict them, obtains the predicted angle, and then combines the instance segmentation model to perform instance segmentation on the image data, calculates the angle of the image data divided into several parts on average, and combines the angle to determine the angle error of the predicted angle and the above-classified angle, thereby improving the accuracy of the angle of the obtained detection window.
[0026] As a preferred example, when the first absolute value, the second absolute value and the third absolute value are all greater than the absolute value threshold, an abnormal alarm is issued, including:
[0027] comparing the first absolute value with the absolute value threshold, and when the first absolute value is greater than the absolute value threshold, comparing the second absolute value with the third absolute value and comparing the second absolute value with the absolute value threshold;
[0028] When the second absolute value is greater than or equal to the third absolute value and the second absolute value is greater than the absolute value threshold, the second absolute value is compared with the third absolute value and the third absolute value is compared with the absolute value threshold;
[0029] When the third absolute value is greater than or equal to the second absolute value and the third absolute value is greater than the absolute value threshold, an abnormal alarm is issued.
[0030] The present invention limits the differences between the first window angle, the second window angle and the third window angle obtained above by setting an absolute value threshold. When the difference between any two windows is within the absolute value threshold range, the window angle of the obtained detection window is supported in many aspects, thereby ensuring the accuracy of the window angle. When the difference between any two windows is outside the absolute value threshold range, indicating that a large error exists in the window angle obtained at this time, an abnormal alarm is issued at this time to facilitate re-identification of the angle, thereby improving the accuracy and efficiency of angle identification.
[0031] As a preferred example, the calculating a first average value of the first window angle and the third window angle or a second average value of the second window angle and the third window angle to obtain the window angle corresponding to the detection window includes:
[0032] When the first absolute value is greater than the absolute value threshold, comparing the second absolute value with the third absolute value and comparing the second absolute value with the absolute value threshold;
[0033] When the second absolute value is smaller than the third absolute value and the second absolute value is smaller than or equal to the absolute value threshold, an average value of the first window angle and the third window angle is calculated, and a window angle corresponding to the detection window is obtained according to the average value.
[0034] The present invention sets an absolute value threshold to limit the error of the angle recognition, improves the accuracy of angle recognition, and simultaneously calculates the average value of the first window angle and the third window angle as the final window angle. On the one hand, it improves the accuracy of the finally determined angle, and on the other hand, it realizes automatic recognition of the angle and improves the efficiency of window angle recognition.
[0035] As a preferred example, in calculating a first average value of the first window angle and the third window angle or a second average value of the second window angle and the third window angle to obtain a window angle corresponding to the detection window, the method further includes:
[0036] When the first absolute value is greater than the absolute value threshold, comparing the second absolute value with the third absolute value and comparing the second absolute value with the absolute value threshold;
[0037] When the second absolute value is greater than or equal to the third absolute value and the second absolute value is greater than the absolute value threshold, the third absolute value is compared with the second absolute value and the third absolute value is compared with the absolute value threshold;
[0038] When the third absolute value is less than the second absolute value and the third absolute value is less than or equal to the absolute value threshold, an average value of the second window angle and the third window angle is calculated, and a window angle corresponding to the detection window is obtained according to the average value.
[0039] The present invention sets an absolute value threshold to limit the error of the angle recognition, improves the accuracy of angle recognition, and simultaneously calculates the average value of the second window angle and the third window angle as the final window angle. On the one hand, it improves the accuracy of the finally determined angle, and on the other hand, it realizes automatic recognition of the angle and improves the efficiency of window angle recognition.
[0040] As a preferred example, in calculating a fourth average of the first window angle, the second window angle, and the third window angle according to the third average value, obtaining a window angle corresponding to the detection window includes:
[0041] Calculating a fifth absolute value of a difference between the third average value and the third window angle, and comparing the fifth absolute value with the absolute value threshold;
[0042] When the fifth absolute value is greater than the absolute value threshold, an abnormal alarm is issued;
[0043] When the fifth absolute value is less than or equal to the absolute value threshold, a fourth average value of the first window angle, the second window angle and the third window angle is calculated, and the window angle corresponding to the detection window is determined according to the fourth average value.
[0044] When determining that the errors between the first window angle, the second window angle and the third window angle are all within the limited absolute value threshold range, the present invention uses the average value of the above multiple angles as the final window angle, so as to improve the accuracy of the window angle recognition.
[0045] In a second aspect, the present invention discloses a fermentation detection device based on classification regression, which is applicable to a fermentation detection machine, wherein the fermentation detection machine includes an image acquisition component and a near infrared detection device; the fermentation detection device includes an image processing module, a first logic determination module, an abnormality recognition module, a first angle recognition module, a second angle recognition module and a fermentation detection module;
[0046] The image processing module is used to control the image acquisition component to obtain image data of the detection window of the fermentation tank to be detected, and input the image data into the pre-trained angle classification model, angle regression model and instance segmentation model respectively to obtain the first window angle, the second window angle and the third window angle corresponding to the detection window;
[0047] The first logic determination module is used to calculate a first absolute value of a difference between the first window angle and the second window angle, a second absolute value of a difference between the first window angle and the third window angle, and a third absolute value of a difference between the second window angle and the third window angle, and compare the first absolute value, the second absolute value, and the third absolute value with a preset absolute value threshold value, respectively;
[0048] The abnormality identification module is used for generating an abnormality alarm when the first absolute value, the second absolute value and the third absolute value are all greater than the absolute value threshold;
[0049] The first angle recognition module is used to calculate a first average value of the first window angle and the third window angle or a second average value of the second window angle and the third window angle when the first absolute value is greater than the absolute value threshold and the second absolute value or the third absolute value is less than or equal to the absolute value threshold, so as to obtain a window angle corresponding to the detection window;
[0050] The second angle recognition module is used for calculating a third average value of the first window angle and the second window angle when the first absolute value is less than or equal to the absolute value threshold, and calculating a fourth average value of the first window angle, the second window angle and the third window angle according to the third average value to obtain a window angle corresponding to the detection window;
[0051] The fermentation detection module is used to adjust the angle of the near-infrared detection device according to the window angle, control the near-infrared detection device to fit the detection window according to the angle, detect the concentration of the fermentation liquid in the fermentation tank to be detected, and obtain the concentration of the fermentation liquid in the fermentation tank to be detected.
[0052] The present invention discloses a fermentation detection device based on classification and regression. First, the image data corresponding to the current detection window are processed respectively by using a pre-trained angle classification model, an angle regression model and an instance segmentation model, and the first window angle, the second window angle and the third window angle are obtained in turn after the angle classification, angle regression and instance segmentation of the current image data, so as to facilitate the subsequent mutual verification of the results obtained by using the angle classification, angle regression and instance segmentation, strictly reduce the angle error, improve the accuracy of the angle of the obtained detection window, thereby reducing the number of angle adjustments of the near-infrared device and improving the efficiency of fermentation detection. Furthermore, after obtaining the different window angles, the error between the angle judgments is strictly limited by comparing the absolute value corresponding to the difference between the two different window angles by using a preset absolute value threshold and the absolute value, and at the same time, according to the different results corresponding to the different comparisons, the average value corresponding to the different window angles is calculated as the final window angle, so that the accuracy of the final window angle is very high. The angle of the near-infrared device is adjusted by using the window angle finally obtained after a series of logical judgments, thereby avoiding manual adjustment, reducing the adjustment error and improving the efficiency of fermentation detection.
[0053] As a preferred example, the image processing module includes an image acquisition unit, an angle classification unit, an angle regression unit and an angle segmentation unit;
[0054] The image acquisition unit is used to control the image acquisition component to acquire the initial color image corresponding to the detection window, and perform denoising on the initial color image to obtain image data corresponding to the detection window;
[0055] The angle classification unit is used to input the image data into a pre-trained angle classification model, perform angle reasoning on the image data through different nodes preset in the angle classification model, obtain a plurality of dimensional vectors corresponding to the image data and assign a value to each of the plurality of dimensional vectors; wherein each of the plurality of dimensional vectors corresponds to a different window angle; and according to the assignment of each of the plurality of dimensional vectors, obtain a first window angle corresponding to the detection window;
[0056] The angle regression unit is used to input the image data into a pre-trained angle regression model, extract image features corresponding to the image data through the angle regression model, predict the angle of the detection window according to the image features, and output the second window angle;
[0057] The angle segmentation unit is used to input the image data into a pre-trained instance segmentation model, perform instance segmentation on the image data through the instance segmentation model, and obtain a number of segmentation areas corresponding to the image data; calculate the angle between the center points of two adjacent segmentation areas in the number of segmentation areas through the instance segmentation model to obtain a number of segmentation angles corresponding to the image data; calculate the average value corresponding to the number of segmentation angles through the instance segmentation model to obtain the third window angle.
[0058] The present invention sets the angle classification model and the angle regression model to extract features from image data to classify and predict angles, and then combines the instance segmentation model to perform instance segmentation on the image data, calculates the angle of the image data divided into several parts on average, and combines the angle to determine the angle error of the predicted angle and the above-classified angle, thereby improving the accuracy of the angle of the obtained detection window.
[0059] In a third aspect, the present invention further discloses a fermentation detection machine, including an image acquisition component and a near infrared detection device;
[0060] The image acquisition component is used to obtain image data of the detection window of the fermentation tank to be detected;
[0061] The near infrared detection device is used to detect the concentration of the fermentation liquid in the fermentation tank to be detected by fitting with the detection window according to the window angle of the detection window, so as to obtain the concentration of the fermentation liquid in the fermentation tank to be detected. BRIEF DESCRIPTION OF THE DRAWINGS
[0062] Figure 1 : A schematic diagram of a fermentation detection method based on classification regression disclosed in an embodiment of the present invention;
[0063] Figure 2 : A schematic diagram of the structure of a fermentation detection device based on classification regression disclosed in an embodiment of the present invention;
[0064] Figure 3 : A schematic diagram of the structure of a fermentation detection machine disclosed in an embodiment of the present invention;
[0065] Figure 4 : A schematic diagram of the specific structure of a fermentation detection machine disclosed in another embodiment of the present invention;
[0066] Figure 5 : A schematic diagram of a fermentation detection method based on classification regression disclosed in another embodiment of the present invention;
[0067] Figure 6 : is a structural schematic diagram of a detection window of a fermentation tank disclosed in another embodiment of the present invention;
[0068] Figure 7 : A schematic diagram of image segmentation disclosed in another embodiment of the present invention;
[0069] Figure 8 : A schematic diagram of angle segmentation of an image disclosed in another embodiment of the present invention. DETAILED DESCRIPTION
[0070] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0071] Embodiment 1
[0072] This embodiment discloses a fermentation detection method based on classification regression. The detection method is applicable to a fermentation detection machine, which includes an image acquisition component and a near infrared detection device. The implementation process of the fermentation detection method can refer to Figure 1 , mainly including steps 101 to 105, the steps including:
[0073] Step 101: Control the image acquisition component to obtain image data of the detection window of the fermentation tank to be detected, and input the image data into the pre-trained angle classification model, angle regression model and instance segmentation model respectively to obtain the first window angle, second window angle and third window angle corresponding to the detection window.
[0074] In this embodiment, this step mainly includes: controlling the image acquisition component to obtain the initial color image corresponding to the detection window, and performing denoising processing on the initial color image to obtain image data corresponding to the detection window.
[0075] The image data is input into a pre-trained angle classification model, and the angles of the image data are inferred respectively through different nodes preset in the angle classification model to obtain a plurality of dimensional vectors corresponding to the image data and assign values to each of the plurality of dimensional vectors; wherein each of the plurality of dimensional vectors corresponds to a different window angle; and according to the assignment of each of the plurality of dimensional vectors, a first window angle corresponding to the detection window is obtained.
[0076] At the same time, the image data is input into a pre-trained angle regression model, image features corresponding to the image data are extracted through the angle regression model, the angle of the detection window is predicted according to the image features, and the second window angle is output.
[0077] The image data is input into a pre-trained instance segmentation model, and instance segmentation is performed on the image data through the instance segmentation model to obtain a number of segmentation regions corresponding to the image data; the angle between the center points of two adjacent segmentation regions in the number of segmentation regions is calculated through the instance segmentation model to obtain a number of segmentation angles corresponding to the image data; the average value corresponding to the number of segmentation angles is calculated through the instance segmentation model to obtain the third window angle.
[0078] In this embodiment, this step sets the angle classification model and the angle regression model to extract features from the image data to classify and predict the angles thereof, and then combines the instance segmentation model to perform instance segmentation on the image data, calculates the angles of the image data divided into several parts on average, and combines the angles to determine the angle errors of the predicted angles and the above-classified angles, thereby improving the accuracy of the angle of the obtained detection window.
[0079] Step 102: Calculate a first absolute value of the difference between the first window angle and the second window angle, a second absolute value of the difference between the first window angle and the third window angle, and a third absolute value of the difference between the second window angle and the third window angle, and compare the first absolute value, the second absolute value, and the third absolute value with a preset absolute value threshold, respectively.
[0080] Step 103: When the first absolute value, the second absolute value and the third absolute value are all greater than the absolute value threshold, an abnormal alarm is issued.
[0081] In this embodiment, this step mainly includes: comparing the first absolute value with the absolute value threshold, and when the first absolute value is greater than the absolute value threshold, comparing the second absolute value with the third absolute value and comparing the second absolute value with the absolute value threshold.
[0082] When the second absolute value is greater than or equal to the third absolute value and the second absolute value is greater than the absolute value threshold, the second absolute value is compared with the third absolute value and the third absolute value is compared with the absolute value threshold.
[0083] When the third absolute value is greater than or equal to the second absolute value and the third absolute value is greater than the absolute value threshold, an abnormal alarm is issued.
[0084] In this embodiment, this step limits the difference between the first window angle, the second window angle and the third window angle obtained above by setting an absolute value threshold. When the difference between any two windows is within the absolute value threshold, the window angle of the obtained detection window is supported in many aspects to ensure the accuracy of the window angle. When the difference between any two windows is outside the absolute value threshold, it indicates that there is a large error in the window angle obtained at this time. In this case, an abnormal alarm is issued to facilitate re-identification of the angle, thereby improving the accuracy and efficiency of angle identification.
[0085] Step 104: When the first absolute value is greater than the absolute value threshold and the second absolute value or the third absolute value is less than or equal to the absolute value threshold, calculate a first average value of the first window angle and the third window angle or a second average value of the second window angle and the third window angle to obtain a window angle corresponding to the detection window.
[0086] In this embodiment, this step mainly includes: when the first absolute value is greater than the absolute value threshold, comparing the second absolute value with the third absolute value and comparing the second absolute value with the absolute value threshold; when the second absolute value is less than the third absolute value and the second absolute value is less than or equal to the absolute value threshold, calculating the average value of the first window angle and the third window angle, and obtaining the window angle corresponding to the detection window according to the average value.
[0087] Or when the first absolute value is greater than the absolute value threshold, the second absolute value is compared with the third absolute value and the second absolute value is compared with the absolute value threshold; when the second absolute value is greater than or equal to the third absolute value and the second absolute value is greater than the absolute value threshold, the third absolute value is compared with the second absolute value and the third absolute value is compared with the absolute value threshold; when the third absolute value is less than the second absolute value and the third absolute value is less than or equal to the absolute value threshold, the average value of the second window angle and the third window angle is calculated, and the window angle corresponding to the detection window is obtained according to the average value.
[0088] In this embodiment, this step sets an absolute value threshold to limit the error of the angle recognition, thereby improving the accuracy of angle recognition. At the same time, the average value of the first window angle or the second window angle and the third window angle is calculated as the final window angle. On the one hand, the accuracy of the finally determined angle is improved, and on the other hand, automatic angle recognition is achieved, thereby improving the efficiency of window angle recognition.
[0089] Step 105: When the first absolute value is less than or equal to the absolute value threshold, calculate the third average value of the first window angle and the second window angle, and calculate the fourth average value of the first window angle, the second window angle and the third window angle based on the third average value to obtain the window angle corresponding to the detection window.
[0090] In this embodiment, this step mainly includes: calculating the fifth absolute value of the difference between the third average value and the third window angle, and comparing the fifth absolute value with the absolute value threshold; when the fifth absolute value is greater than the absolute value threshold, an abnormal alarm is issued.
[0091] When the fifth absolute value is less than or equal to the absolute value threshold, a fourth average value of the first window angle, the second window angle and the third window angle is calculated, and the window angle corresponding to the detection window is determined according to the fourth average value.
[0092] In this embodiment, this step determines that the errors between the first window angle, the second window angle and the third window angle are all within the limited absolute value threshold range, and uses the average value of the above multiple angles as the final window angle, so as to improve the accuracy of the window angle recognition.
[0093] Step 106: adjusting the angle of the near-infrared detection device according to the window angle, controlling the near-infrared detection device to fit the detection window according to the angle, detecting the concentration of the fermentation liquid in the fermentation tank to be detected, and obtaining the concentration of the fermentation liquid in the fermentation tank to be detected.
[0094] On the other hand, this embodiment also discloses a fermentation detection device based on classification regression, which is suitable for a fermentation detection machine, wherein the fermentation detection machine includes an image acquisition component and a near infrared detection device; specifically, the specific composition structure of the fermentation detection device can be referred to Figure 2 , mainly includes an image processing module 201, a first logic judgment module 202, an abnormality recognition module 203, a first angle recognition module 204, a second angle recognition module 205 and a fermentation detection module 206.
[0095] The image processing module 201 is used to control the image acquisition component to obtain image data of the detection window of the fermentation tank to be detected, and input the image data into the pre-trained angle classification model, angle regression model and instance segmentation model respectively to obtain the first window angle, second window angle and third window angle corresponding to the detection window.
[0096] The first logic judgment module 202 is used to calculate a first absolute value of the difference between the first window angle and the second window angle, a second absolute value of the difference between the first window angle and the third window angle, and a third absolute value of the difference between the second window angle and the third window angle, and compare the first absolute value, the second absolute value, and the third absolute value with a preset absolute value threshold value, respectively.
[0097] The abnormality identification module 203 is used to generate an abnormality alarm when the first absolute value, the second absolute value and the third absolute value are all greater than the absolute value threshold.
[0098] The first angle recognition module 204 is used to calculate a first average value of the first window angle and the third window angle or a second average value of the second window angle and the third window angle when the first absolute value is greater than the absolute value threshold and the second absolute value or the third absolute value is less than or equal to the absolute value threshold, so as to obtain a window angle corresponding to the detection window.
[0099] The second angle recognition module 205 is used to calculate the third average value of the first window angle and the second window angle when the first absolute value is less than or equal to the absolute value threshold, and calculate the fourth average value of the first window angle, the second window angle and the third window angle according to the third average value to obtain the window angle corresponding to the detection window.
[0100] The fermentation detection module 206 is used to adjust the angle of the near-infrared detection device according to the window angle, control the near-infrared detection device to fit the detection window according to the angle, detect the concentration of the fermentation liquid in the fermentation tank to be detected, and obtain the concentration of the fermentation liquid in the fermentation tank to be detected.
[0101] In this embodiment, the image processing module 201 includes an image acquisition unit, an angle classification unit, an angle regression unit and an angle segmentation unit.
[0102] The image acquisition unit is used to control the image acquisition component to acquire an initial color image corresponding to the detection window, and to perform denoising on the initial color image to obtain image data corresponding to the detection window.
[0103] The angle classification unit is used to input the image data into a pre-trained angle classification model, and perform angle reasoning on the image data through different nodes preset in the angle classification model to obtain several dimensional vectors corresponding to the image data and assign values to each of the several dimensional vectors; wherein each of the several dimensional vectors corresponds to a different window angle; and based on the assignment of each of the several dimensional vectors, a first window angle corresponding to the detection window is obtained.
[0104] The angle regression unit is used to input the image data into a pre-trained angle regression model, extract image features corresponding to the image data through the angle regression model, predict the angle of the detection window according to the image features, and output the second window angle.
[0105] The angle segmentation unit is used to input the image data into a pre-trained instance segmentation model, perform instance segmentation on the image data through the instance segmentation model, and obtain a number of segmentation areas corresponding to the image data; calculate the angle between the center points of two adjacent segmentation areas in the number of segmentation areas through the instance segmentation model to obtain a number of segmentation angles corresponding to the image data; calculate the average value corresponding to the number of segmentation angles through the instance segmentation model to obtain the third window angle.
[0106] In addition to the above method and device, this embodiment also discloses a fermentation detection machine. The specific composition and structure of the fermentation detection machine can be referred to Figure 3 , including an image acquisition component 301 and a near infrared detection device 302.
[0107] The image acquisition component 301 is used to obtain image data of the detection window of the fermentation tank to be detected.
[0108] The near infrared detection device 302 is used to detect the concentration of the fermentation liquid in the fermentation tank to be detected by fitting the detection window according to the window angle of the detection window to obtain the concentration of the fermentation liquid in the fermentation tank to be detected.
[0109] Embodiment 2
[0110] This embodiment further provides a fermentation detection method based on classification regression, and the detection method is applicable to a fermentation detection machine. Specifically, in this embodiment, the specific composition structure of the fermentation detection machine can be referred to Figure 4 , mainly including 3D cameras, near-infrared equipment, electric control boxes, robotic arms, AGV platforms, antennas and sound and light alarms.
[0111] In this embodiment, the 3D camera is used to obtain image data of the detection window of the fermentation tank to be detected, and the near infrared device is used to fit the detection window to detect the concentration of the fermentation liquid in the fermentation tank. The structural schematic diagram of the detection window of the fermentation tank can be referred to Figure 6 ,like Figure 6 The detection window is arranged at the outer end of the fermentation tank, the electrical control box is used to provide power, and the robotic arm is used to adjust the angle of the near-infrared device and control the near-infrared device to fit closely with the detection window, the AGV platform is used to execute the fermentation detection method based on classification regression provided in this embodiment, the antenna is used to receive messages sent from the outside world and then start the fermentation detection machine, and the sound and light alarm is used to alarm for abnormalities in the detection process.
[0112] In this embodiment, the specific implementation process of the fermentation detection method based on classification regression executed in the AGV platform is shown in Figure 5 , mainly including steps 501 to 506, the steps include:
[0113] Step 501: Control the 3D camera to obtain image data of the detection window of the fermentation tank to be inspected, and send the image data to the pre-trained angle classification model, angle regression model and instance segmentation model respectively to obtain the first window angle, second window angle and third window angle corresponding to the detection window.
[0114] In this embodiment, before executing this step, the angle classification model, the angle regression model and the instance segmentation model are first trained. The training process of the angle classification model and the angle regression model is as follows:
[0115] Step 1: First, use EfficientNet to build an initial angle classification model and an initial angle classification model. The EfficientNet is a widely used deep convolutional neural network structure with better accuracy and efficiency than all previous convolutional networks.
[0116] Step 2: During the model training process, first collect 10,000 color images of a single detection window; then annotate the window angle (0-59°) of the detection window in each image.
[0117] Step 3: Using the image as input and the angle as a label, the collected image is used to train the initial angle classification model and the angle regression model respectively until the model converges.
[0118] During the training process, the angle classification model outputs a 60-dimensional vector, which can be any integer between 0 and 59°, while the angle regression model outputs a scalar, which can be any value between 0 and 59, such as 0.3°, 5.7°, 12.3°, etc. At the same time, because the output of the angle classification model is a 60-dimensional vector, its last layer of the network consists of 60 nodes, while the output of the angle regression model is a scalar value, so its last layer of the network has only 1 node.
[0119] The training process of the instance segmentation model is:
[0120] Step 1: First, use Pointrend to build an initial instance segmentation model. Pointrend is a widely used segmentation model with high accuracy and efficiency.
[0121] Step 2: During the model training process, first collect multiple images of a single detection window containing raised screws or other raised objects for image segmentation, and then manually annotate the raised objects on each image.
[0122] Step 3: Using the image as input and the annotation of the raised object as a label, the collected image is used to train the initial instance segmentation model until the model converges. Then, whenever a detection window image is input, the trained graph can immediately output the position of the raised screw area, and calculate the average value of the angle of the detection window based on the position of the raised screw area.
[0123] In this embodiment, the 3D camera is controlled to acquire a color image corresponding to the detection window of the fermentation tank to be inspected. When the 3D camera acquires the image, the size of the image will be automatically compressed to 224*224, and denoising will be performed at the same time. The denoised image with appropriate size will be input into the trained angle classification model, angle regression model and instance segmentation model respectively.
[0124] After the image data is input into the angle classification model, the angle classification model will infer and output a 60-dimensional vector, the elements of which are 0 and 1, and only one dimension element is allowed to be 1, and the other dimensional elements are 0. If the value of the first dimension element is 1, it means that the detection window angle is 0°; if the value of the second dimension element is 1, it means that the detection window angle is 1°; if the value of the third dimension element is 1, it means that the detection window angle is 2°; if the value of the fourth dimension element is 1, it means that the detection window angle is 3°; and so on.
[0125] After the image data is input into the angle regression model, the angle regression model will infer and output a scalar value with a value range of 0-59°, such as 0.3°, 5.7°, 12.3°, etc.
[0126] After the image data is input into the instance segmentation model, in this embodiment, assuming that the raised objects on the image data are 8 raised screws, the instance segmentation model segments 8 raised screw regions from the color image of a single detection window, as shown in FIG. Figure 7 As shown, based on the 8 raised screw areas, we can calculate the keyway angle G, which is the third window angle.
[0127] Reference Figure 7 , the 8 raised screws are equidistantly distributed at the edge of the detection window, that is, the angle between any two adjacent raised screws is 60 degrees. Although the angles of any adjacent raised screws are equal, the distribution of the 8 raised screws at the edge of the detection window is different. After obtaining the positions of the 8 raised screw areas, we can calculate the detection window angle G, which is the third window angle. Specifically, first segment the 8 raised screw areas, and then calculate the angles of the center points of the adjacent areas to obtain 8 angles G1, G2, ..., G8. Finally, calculate the mean G of the 8 angles. The segmentation of the angles can refer to Figure 8 .
[0128] Step 502: Calculate the first absolute value of the difference between the first window angle and the second window angle, the second absolute value of the difference between the first window angle and the third window angle, and the third absolute value of the difference between the second window angle and the third window angle, and compare the first absolute value, the second absolute value, and the third absolute value with a preset absolute value threshold, respectively.
[0129] Step 503: When the first absolute value, the second absolute value and the third absolute value are all greater than the absolute value threshold, an abnormal alarm is issued.
[0130] In this embodiment, the step is: compare the first absolute value, the second absolute value and the third absolute value with a preset absolute value threshold respectively; when the first absolute value is greater than the absolute value threshold, compare the second absolute value with the third absolute value and compare the second absolute value with the absolute value threshold.
[0131] When the second absolute value is greater than or equal to the third absolute value and the second absolute value is greater than the absolute value threshold, the second absolute value is compared with the third absolute value and the third absolute value is compared with the absolute value threshold.
[0132] When the third absolute value is greater than or equal to the second absolute value and the third absolute value is greater than the absolute value threshold, an abnormal alarm is issued.
[0133] In a specific implementation, the absolute value threshold is set to 2 degrees, and when the first absolute value is greater than 2 degrees, the absolute values of the differences between the first window angle, the second window angle and the third window angle are determined respectively. If the absolute values of the differences between the first window angle, the second window angle and the third window angle are all greater than 2 degrees, an abnormal alarm is issued.
[0134] This step is to make the results of angle classification, angle regression, and instance segmentation verify each other, strictly reduce the angle error, and improve the accuracy of the algorithm.
[0135] Step 504: When the first absolute value is less than or equal to the absolute value threshold, calculate the third average value of the first window angle and the second window angle, and calculate the fourth average value of the first window angle, the second window angle and the third window angle based on the third average value to obtain the window angle corresponding to the detection window.
[0136] In this embodiment, the step is: calculate the fifth absolute value of the difference between the third average value and the third window angle, and compare the fifth absolute value with the absolute value threshold; when the fifth absolute value is greater than the absolute value threshold, an abnormal alarm is issued; when the fifth absolute value is less than or equal to the absolute value threshold, calculate the fourth average value of the first window angle, the second window angle and the third window angle, and determine the window angle corresponding to the detection window according to the fourth average value.
[0137] Specifically, in this embodiment, the first window angle is set to A, the second window angle is set to B, and the third window angle is set to G. When the absolute value of A minus B is less than or equal to 2 degrees, the average C of A and B is calculated, and the absolute value of the difference between C and G is calculated. When the absolute value of the difference between C and G is less than or equal to the absolute value threshold of 2 degrees, the window angle corresponding to the detection window is set to E, and E=(A+B+G) / 3.
[0138] Step 505: When the first absolute value is greater than the absolute value threshold and the second absolute value or the third absolute value is less than or equal to the absolute value threshold, calculate the first average value of the first window angle and the third window angle or the second average value of the second window angle and the third window angle to obtain the window angle corresponding to the detection window.
[0139] In this embodiment, the step is: when the first absolute value is greater than the absolute value threshold, the second absolute value is compared with the third absolute value and the second absolute value is compared with the absolute value threshold; when the second absolute value is less than the third absolute value and the second absolute value is less than or equal to the absolute value threshold, the average value of the first window angle and the third window angle is calculated, and the window angle corresponding to the detection window is obtained according to the average value.
[0140] When the first absolute value is greater than the absolute value threshold, the second absolute value is compared with the third absolute value and the second absolute value is compared with the absolute value threshold; when the second absolute value is greater than or equal to the third absolute value and the second absolute value is greater than the absolute value threshold, the third absolute value is compared with the second absolute value and the third absolute value is compared with the absolute value threshold; when the third absolute value is less than the second absolute value and the third absolute value is less than or equal to the absolute value threshold, the average value of the second window angle and the third window angle is calculated, and the window angle corresponding to the detection window is obtained according to the average value.
[0141] Specifically, in a specific implementation provided in this embodiment, the first window angle is set to A, the second window angle is set to B, and the third window angle is set to G. When the absolute value of the difference between A and B is greater than the absolute value threshold, i.e., 2 degrees, and |AG|<|BG| and |AG|≤2, then E=(A+G) / 2. When |AG|>=|BG| and |AG|>2, and |BG|<|AG| and |BG|≤2, then E=(B+G) / 2.
[0142] Step 506: adjusting the angle of the near-infrared detection device according to the window angle, controlling the near-infrared detection device to fit the detection window according to the angle, detecting the concentration of the fermentation liquid in the fermentation tank to be detected, and obtaining the concentration of the fermentation liquid in the fermentation tank to be detected.
[0143] In this embodiment, the step is: according to the window angle of the detection window, the rotation angle of the near-infrared device is adjusted by controlling the robotic arm, and after adjusting the rotation angle, the near-infrared device is controlled to fit the detection window of the fermentation tank to detect the concentration of the fermentation liquid in the fermentation tank.
[0144] The present embodiment provides a fermentation detection method based on classification and regression, which adds angle classification and angle regression on the basis of instance segmentation, and designs sophisticated logical judgment, so that the accuracy of angle judgment is very high, with an error of about 0.2 degrees, thereby improving the accuracy of detection window angle recognition and thus improving the efficiency of fermentation detection.
[0145] The specific embodiments described above further illustrate the purpose, technical solutions and beneficial effects of the present invention. It should be understood that the above description is only a specific embodiment of the present invention and is not intended to limit the scope of protection of the present invention. It is particularly pointed out that for those skilled in the art, any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention should be included in the scope of protection of the present invention.
Claims
1. A fermentation detection method based on classification regression, characterized in that: Applicable to fermentation detection machinery, the fermentation detection machinery includes an image acquisition component and a near infrared detection device; the fermentation detection method includes: Control the image acquisition component to obtain image data of the detection window of the fermentation tank to be detected, and input the image data into a pre-trained angle classification model, an angle regression model and an instance segmentation model, respectively, to obtain a first window angle, a second window angle and a third window angle corresponding to the detection window; Calculate a first absolute value of a difference between the first window angle and the second window angle, a second absolute value of a difference between the first window angle and the third window angle, and a third absolute value of a difference between the second window angle and the third window angle, and compare the first absolute value, the second absolute value, and the third absolute value with a preset absolute value threshold value, respectively; When the first absolute value, the second absolute value and the third absolute value are all greater than the absolute value threshold, an abnormal alarm is issued; When the first absolute value is greater than the absolute value threshold and the second absolute value or the third absolute value is less than or equal to the absolute value threshold, calculating a first average value of the first window angle and the third window angle or a second average value of the second window angle and the third window angle to obtain a window angle corresponding to the detection window; When the first absolute value is less than or equal to the absolute value threshold, a third average value of the first window angle and the second window angle is calculated, and a fourth average value of the first window angle, the second window angle and the third window angle is calculated according to the third average value to obtain a window angle corresponding to the detection window; The angle of the near-infrared detection device is adjusted according to the window angle, and the near-infrared detection device is controlled to fit the detection window according to the angle to detect the concentration of the fermentation liquid in the fermentation tank to be detected, so as to obtain the concentration of the fermentation liquid in the fermentation tank to be detected.
2. A fermentation detection method based on classification regression as claimed in claim 1, characterized in that: The controlling the image acquisition component to obtain image data of the detection window of the fermentation tank to be detected, and inputting the image data into the pre-trained angle classification model, angle regression model and instance segmentation model respectively, to obtain the first window angle, the second window angle and the third window angle corresponding to the detection window, including: Controlling the image acquisition component to acquire an initial color image corresponding to the detection window, and performing denoising processing on the initial color image to obtain image data corresponding to the detection window; The image data is input into a pre-trained angle classification model, and the angle of the image data is inferred respectively through different nodes preset in the angle classification model to obtain a plurality of dimensional vectors corresponding to the image data and assign a value to each of the plurality of dimensional vectors; wherein each of the plurality of dimensional vectors corresponds to a different window angle; According to the assignment of each dimensional vector in the plurality of dimensional vectors, a first window angle corresponding to the detection window is obtained.
3. A fermentation detection method based on classification regression as claimed in claim 1, characterized in that: The step of inputting the image data into a pre-trained angle classification model, an angle regression model, and an instance segmentation model to obtain a first window angle, a second window angle, and a third window angle corresponding to the detection window further includes: Input the image data into a pre-trained angle regression model, extract image features corresponding to the image data through the angle regression model, predict the angle of the detection window according to the image features, and output the second window angle; Inputting the image data into a pre-trained instance segmentation model, performing instance segmentation on the image data through the instance segmentation model, and obtaining a plurality of segmented regions corresponding to the image data; Calculating the angles between center points of two adjacent segmented regions in the plurality of segmented regions by using the instance segmentation model to obtain a plurality of segmentation angles corresponding to the image data; The third window angle is obtained by calculating the average values corresponding to the plurality of segmentation angles through the instance segmentation model.
4. A fermentation detection method based on classification regression as claimed in claim 1, characterized in that: When the first absolute value, the second absolute value and the third absolute value are all greater than the absolute value threshold, an abnormal alarm is issued, including: comparing the first absolute value with the absolute value threshold, and when the first absolute value is greater than the absolute value threshold, comparing the second absolute value with the third absolute value and comparing the second absolute value with the absolute value threshold; When the second absolute value is greater than or equal to the third absolute value and the second absolute value is greater than the absolute value threshold, the second absolute value is compared with the third absolute value and the third absolute value is compared with the absolute value threshold; When the third absolute value is greater than or equal to the second absolute value and the third absolute value is greater than the absolute value threshold, an abnormal alarm is issued.
5. A fermentation detection method based on classification regression as claimed in claim 1, characterized in that: The calculating a first average value of the first window angle and the third window angle or a second average value of the second window angle and the third window angle to obtain a window angle corresponding to the detection window includes: When the first absolute value is greater than the absolute value threshold, comparing the second absolute value with the third absolute value and comparing the second absolute value with the absolute value threshold; When the second absolute value is smaller than the third absolute value and the second absolute value is smaller than or equal to the absolute value threshold, an average value of the first window angle and the third window angle is calculated, and a window angle corresponding to the detection window is obtained according to the average value.
6. A fermentation detection method based on classification regression as claimed in claim 1, characterized in that: The calculating a first average value of the first window angle and the third window angle or a second average value of the second window angle and the third window angle to obtain the window angle corresponding to the detection window also includes: When the first absolute value is greater than the absolute value threshold, comparing the second absolute value with the third absolute value and comparing the second absolute value with the absolute value threshold; When the second absolute value is greater than or equal to the third absolute value and the second absolute value is greater than the absolute value threshold, the third absolute value is compared with the second absolute value and the third absolute value is compared with the absolute value threshold; When the third absolute value is less than the second absolute value and the third absolute value is less than or equal to the absolute value threshold, an average value of the second window angle and the third window angle is calculated, and a window angle corresponding to the detection window is obtained according to the average value.
7. A fermentation detection method based on classification regression as claimed in claim 1, characterized in that: The calculating a fourth average of the first window angle, the second window angle, and the third window angle according to the third average to obtain a window angle corresponding to the detection window includes: Calculating a fifth absolute value of a difference between the third average value and the third window angle, and comparing the fifth absolute value with the absolute value threshold; When the fifth absolute value is greater than the absolute value threshold, an abnormal alarm is issued; When the fifth absolute value is less than or equal to the absolute value threshold, a fourth average value of the first window angle, the second window angle and the third window angle is calculated, and the window angle corresponding to the detection window is determined according to the fourth average value.
8. A fermentation detection device based on classification regression, characterized in that: Applicable to fermentation detection machinery, the fermentation detection machinery includes an image acquisition component and a near-infrared detection device; the fermentation detection device includes an image processing module, a first logic determination module, an abnormality recognition module, a first angle recognition module, a second angle recognition module and a fermentation detection module; The image processing module is used to control the image acquisition component to obtain image data of the detection window of the fermentation tank to be detected, and input the image data into the pre-trained angle classification model, angle regression model and instance segmentation model respectively to obtain the first window angle, the second window angle and the third window angle corresponding to the detection window; The first logic determination module is used to calculate a first absolute value of a difference between the first window angle and the second window angle, a second absolute value of a difference between the first window angle and the third window angle, and a third absolute value of a difference between the second window angle and the third window angle, and compare the first absolute value, the second absolute value, and the third absolute value with a preset absolute value threshold value, respectively; The abnormality identification module is used for generating an abnormality alarm when the first absolute value, the second absolute value and the third absolute value are all greater than the absolute value threshold; The first angle recognition module is used to calculate a first average value of the first window angle and the third window angle or a second average value of the second window angle and the third window angle when the first absolute value is greater than the absolute value threshold and the second absolute value or the third absolute value is less than or equal to the absolute value threshold, so as to obtain a window angle corresponding to the detection window; The second angle recognition module is used for calculating a third average value of the first window angle and the second window angle when the first absolute value is less than or equal to the absolute value threshold, and calculating a fourth average value of the first window angle, the second window angle and the third window angle according to the third average value to obtain a window angle corresponding to the detection window; The fermentation detection module is used to adjust the angle of the near-infrared detection device according to the window angle, control the near-infrared detection device to fit the detection window according to the angle, detect the concentration of the fermentation liquid in the fermentation tank to be detected, and obtain the concentration of the fermentation liquid in the fermentation tank to be detected.
9. A fermentation detection device based on classification regression as claimed in claim 8, characterized in that: The image processing module includes an image acquisition unit, an angle classification unit, an angle regression unit and an angle segmentation unit; The image acquisition unit is used to control the image acquisition component to acquire the initial color image corresponding to the detection window, and perform denoising on the initial color image to obtain image data corresponding to the detection window; The angle classification unit is used to input the image data into a pre-trained angle classification model, perform angle reasoning on the image data through different nodes preset in the angle classification model, obtain a plurality of dimensional vectors corresponding to the image data and assign a value to each of the plurality of dimensional vectors; wherein each of the plurality of dimensional vectors corresponds to a different window angle; and according to the assignment of each of the plurality of dimensional vectors, obtain a first window angle corresponding to the detection window; The angle regression unit is used to input the image data into a pre-trained angle regression model, extract image features corresponding to the image data through the angle regression model, predict the angle of the detection window according to the image features, and output the second window angle; The angle segmentation unit is used to input the image data into a pre-trained instance segmentation model, perform instance segmentation on the image data through the instance segmentation model, and obtain a number of segmentation areas corresponding to the image data; calculate the angle between the center points of two adjacent segmentation areas in the number of segmentation areas through the instance segmentation model to obtain a number of segmentation angles corresponding to the image data; calculate the average value corresponding to the number of segmentation angles through the instance segmentation model to obtain the third window angle.
10. A fermentation detection machine, characterized in that: Includes image acquisition components and near infrared detection equipment; The image acquisition component is used to obtain image data of the detection window of the fermentation tank to be detected; The near infrared detection device is used to detect the concentration of the fermentation liquid in the fermentation tank to be detected by fitting with the detection window according to the window angle of the detection window, so as to obtain the concentration of the fermentation liquid in the fermentation tank to be detected.
