Quality detection method of mitochondrial nutrient goat milk powder based on image processing

Through spectral image processing technology, the spectral data of goat milk powder detection samples are obtained, the spectral data is compared with standard data, the unqualified parts are identified, and the concentration information of unqualified components is accurately obtained through target band analysis and machine learning model, which solves the problem of difficult to obtain the concentration of components in the existing technology.

CN119861044AActive Publication Date: 2025-04-22ZHENMU (HANGZHOU) HEALTH TECHNOLOGY CO LTD
View PDF 9 Cites 0 Cited by

Patent Information

Application Number
CN202510358972.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-25
Publication Date
2025-04-22
Estimated Expiration
2045-03-25

AI Technical Summary

Technical Problem

When the prior art recognizes abnormal states through spectral images, it is difficult to obtain the specific concentration of the target component to be detected, and the relationship between the spectral characteristics between the components is not considered.

Method used

By acquiring multiple first spectral images of the detection sample, M pixels are randomly selected for preprocessing, a spectral image to be detected is generated, and compared with the standard spectral image. If it fails, the target band with a reflectance difference greater than the second threshold is obtained, the concentration information of the target object is obtained, and the concentration information of each target detection object is further obtained based on the machine learning model.

Benefits of technology

The accuracy of the quality detection of mitochondrial nutrient goat milk powder is achieved, and the specific concentration information of unqualified target detection objects can be obtained to help adjust production parameters.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119861044A_ABST
    Figure CN119861044A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of image processing, in particular to a quality detection method of mitochondrial nutrient goat milk powder based on image processing. The method comprises the following steps: S1, acquiring a plurality of first spectral images of a detection sample, and preprocessing initial spectral images in M pixels to acquire M second spectral images; s2, acquiring a to-be-detected spectral image, comparing the to-be-detected spectral image with the standard spectral image to obtain a comparison result, and judging whether the detection sample is qualified or not; s3, when the detection sample is unqualified, acquiring a first object and concentration information of the first object according to the spectral features corresponding to the target detection object and the target wave band; and S4, acquiring the concentration information of each target detection object corresponding to the target wave band according to the spectral characteristics of the target detection object, the first object, the concentration information of the first object and the second model. The problem of inaccurate milk powder quality detection is solved, and the milk powder quality detection precision is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of image processing, and more specifically to a quality detection method of mitochondrial nutrient goat milk powder based on image processing. Background Art

[0002] Detecting food quality through spectral images is a non-destructive, fast and effective technology, which has been widely used in the field of food quality control. Similar prior art includes a Chinese patent with publication number CN118674954B. A Chinese medicine quality detection system based on image recognition is proposed, which relates to the field of image recognition technology and effectively improves the accuracy of Chinese medicine quality detection. A three-dimensional image model of Chinese medicine is generated according to training image data sets in various states, and several detection areas are respectively set on the three-dimensional image model of Chinese medicine, and then several pixel value jump vectors and abnormal pixel areas are set in each detection area. The abnormal pixel areas generated when different model pixels are used as the first starting pixel are overlapped and mapped, and then several abnormal condition areas are divided in the detection area under different states. A target three-dimensional image model is generated according to the detection image data set, and several target detection areas are set in the target three-dimensional image model, and then the detection pixel value jump vector of the target detection area is obtained, and the quality of the target Chinese medicine is evaluated according to the matching status between the detection pixel value jump vector and the abnormal condition area. In addition, similar prior art includes a US patent with publication number US20240265673A1, which proposes a system and method for detecting gases in the atmosphere from a multispectral image including multiple pixels, each pixel having a spectral feature, the spectral feature including a set of electromagnetic (EM) energy intensities reflected in various bands, the method comprising: clustering multiple pixels based on a spectral feature channel indicating the presence of gas to generate a first group of clusters; clustering multiple pixels based on a spectral feature channel not indicating the presence of gas to generate a second group of clusters; matching clusters from the first group of clusters and the second group of clusters; and marking clusters that exist in the first group of clusters but not in the second group of clusters as suspected of containing gas. Both of the above patents solve the problem of identifying abnormal conditions through spectral images, but neither of them further obtains specific details of the abnormal conditions based on the spectral images, such as: the specific concentration of the components of the detection object, and does not consider the relationship between the spectral features of the components. Summary of the invention

[0003] In order to better solve the above problems, the present invention provides a mitochondrial nutrient goat milk powder quality detection method based on image processing, which is used to detect the quality of the mitochondrial nutrient goat milk powder, and the method comprises the following steps: Step S1: obtaining a test sample, obtaining a plurality of first spectral images of the test sample through an imaging unit, randomly selecting M pixels at different positions in the plurality of first spectral images, and preprocessing the initial spectral images in the M pixels to obtain M second spectral images; Step S2: acquiring a spectrum image to be detected based on the M second spectrum images, and comparing the spectrum image to be detected with a standard spectrum image to obtain a comparison result, and judging whether the detection sample is qualified according to the comparison result; Step S3: when the test sample is unqualified, based on the comparison result, a target band whose reflectance difference between the spectral image to be tested and the standard spectral image is greater than a second threshold is obtained, a first object is obtained according to the spectral feature corresponding to the target detection object of the test sample and the target band, and concentration information of the first object is obtained according to the first object and the first model; Step S4: acquiring the concentration information of each target detection object corresponding to the target band according to the spectral characteristics of each target detection object in the target band, the first object, the concentration information of the first object and the second model.

[0004] As a preferred technical solution of the present invention, step S1 includes the following steps: Step S11: obtaining the mitochondrial goat milk powder sample to be tested as the test sample, and placing the test sample into a test container, wherein a stirring device is provided in the test container; Step S12: stirring the sample in different directions by the stirring device at preset time intervals, and acquiring a plurality of the first spectral images of the sample by the imaging unit during the time interval when the stirring is stopped; Step S13: randomly selecting M pixels at different positions from the plurality of first spectral images as target pixels, and obtaining an initial spectral image corresponding to each of the target pixels, and preprocessing the initial spectral image, and obtaining M second spectral images.

[0005] As a preferred technical solution of the present invention, in step S1, preprocessing the spectral image includes: Step S130: obtaining reflectance data of light of different wavelengths in each of the initial spectrum graphs, and sorting the reflectance data of light of different wavelengths from short to long according to wavelength to obtain a spectrum data sequence; Step S131: sliding a sliding window of a preset size from the starting position of the spectral data sequence, selecting N minimum reflectance data in the sliding window, obtaining an average value of the N minimum reflectance data, and replacing the reflectance data corresponding to the center position of the sliding window with the average value; Step 132: Slide the sliding window with a sliding step of 1, and repeat the method of step S131 to correct the reflectivity data corresponding to the center position of the sliding window, and repeat this step until the amount of remaining reflectivity data is less than the size of the sliding window.

[0006] As a preferred technical solution of the present invention, in step S1, preprocessing the spectral image further includes: When the number of the reflectance data remaining at the head of the spectral data sequence is less than 1 / 2 of the sliding window and the number of the reflectance data remaining at the tail of the spectral data sequence is less than the size of the sliding window, the reflectance data is used as the data to be processed, and each of the data to be processed is compared with at least two of its consecutive adjacent reflectance data to obtain a maximum comparison result. When the maximum comparison result is less than or equal to a first threshold, the data to be processed does not need to be corrected. When the maximum comparison result is greater than the first threshold, the data to be processed and its at least two consecutive adjacent reflectance data are averaged and the obtained average replaces the data to be processed.

[0007] As a preferred technical solution of the present invention, step S2 includes: Step S21: Calculate the mean of the M second spectral images to obtain the spectral image to be detected, and compare the spectral image to be detected with the standard spectral image in the same coordinate system to obtain the comparison result, wherein the standard spectral image is the spectral image corresponding to the detection sample that meets the detection standard; Step S22: When the comparison result is that the maximum difference in corresponding reflectance between the to-be-detected spectral image and the standard spectral image in the same band is less than or equal to a second threshold, the detection sample is qualified; otherwise, the detection sample is unqualified.

[0008] As a preferred technical solution of the present invention, step S3 includes: Step S31: when the test sample is unqualified, obtaining, through the comparison result, a target band in which the difference in reflectance between the standard spectrum image and the spectrum image to be tested corresponding to the same wavelength of light is greater than a second threshold; Step S32: Obtain the spectral characteristics of the target detection object corresponding to the detection sample, and based on the spectral characteristics, obtain the first target sub-band in the target band corresponding to the unique target detection object, and take the target detection object as the first object, and input the first sub-image in the spectral image to be detected corresponding to the first target sub-band and the first object into the first model to obtain the concentration of the first object.

[0009] As a preferred technical solution of the present invention, step S4 includes: Step S41: taking the remaining band of the target band minus the first target sub-band corresponding to the first object as the second target sub-band, obtaining the second target sub-band corresponding to the second object in the target detection object that only overlaps with the main reflection band of the first object according to the spectral characteristics of each target detection object, and obtaining the third target sub-band in the second target sub-band where the main reflection band of the first object and the second object overlap, corresponding to the third sub-image in the spectral image to be detected; Step S42: inputting the third target sub-band, the first object and the concentration information of the first object, the second object and the third sub-image into the second model to obtain the concentration information of the second object; Step S43: Repeat the method of step S41 and step S42 to obtain the concentration information of each target detection object corresponding to the target band.

[0010] As a preferred technical solution of the present invention, the second model is a machine learning model trained with spectral images obtained by mixing different numbers of the target detection objects according to different concentration ratios, the target detection objects and the concentration information of the target detection objects as training data.

[0011] As a preferred technical solution of the present invention, the first spectral image and the second spectral image are images with reflectivity as the y-axis and wavelength as the x-axis.

[0012] Compared with the prior art, the beneficial effects of the present invention are at least as follows: The present invention randomly selects M pixels from different positions in the plurality of first spectral images as target pixels. Since each of the target pixels is superimposed with reflectance data of light of different wavelengths and forms a complete spectral curve, in order to filter out the noise in the spectral curve, a spectral data sequence is firstly acquired, and a sliding window of a preset size is used to slide from the starting position of the spectral data sequence. N minimum reflectance values ​​are selected in the sliding window, and the average of the N minimum reflectance data values ​​is used as the reflectance data of the wavelength corresponding to the middle position of the sliding window. When the head of the spectral data sequence is smaller than 1 / 2 of the position of the sliding window and the number of remaining data to be processed is smaller than the length of the sliding window, the data to be processed is compared with at least two adjacent and continuous reflectance data, and the data to be processed is acquired and corrected according to the maximum comparison result, thereby achieving Correction of each of the above spectral data also obtains and compares the above spectral image to be detected with the above standard spectral image in the same coordinate system, and obtains the comparison result to determine whether the above test sample is qualified. When it is unqualified, the target band in which the reflectivity difference between the above spectral image to be detected and the above standard spectral image corresponding to the same wavelength of light is greater than the second threshold is obtained, and the first object and the concentration information of the first object are obtained. The concentration information of the second object is also obtained based on the second object and the corresponding second target sub-band and the first object, the first object concentration information and the second model. Similarly, the concentration information of each of the above target detection objects in the above target band is obtained. Through the mutual cooperation of the above technical solutions, not only the quality inspection results of the above test samples can be obtained, but also the concentration information of each unqualified target detection object can be accurately obtained, so as to facilitate the adjustment of production information according to the concentration information of the unqualified target detection objects. BRIEF DESCRIPTION OF THE DRAWINGS

[0013] Figure 1 The present invention is a flow chart of a quality detection method of mitochondrial nutrient milk powder based on image processing. DETAILED DESCRIPTION

[0014] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.

[0015] The present invention provides a quality detection method for mitochondrial nutrient goat milk powder based on image processing, wherein the components of the mitochondrial nutrient goat milk powder include: whole goat milk powder, inulin, epigallocatechin gallate, olive fruit powder, powdered phytosterol esters, fish meal oil, L-carnitine tartrate, bamboo leaf flavonoids, animal Bifidobacterium lactis subsp. Bb-12, Dendrobium officinale powder and milk mineral salts; wherein the olive fruit powder contains hydroxylated alcohol. Specifically, the mitochondrial nutrients in the formula of the above-mentioned mitochondrial nutrient goat milk powder include epigallocatechin gallate, olive fruit powder, powdered phytosterol esters, fish meal oil and L-carnitine tartrate, and the above-mentioned mitochondrial nutrients can protect the mitochondrial function or promote the function of mitochondria, and assist in improving blood sugar and blood lipids. Figure 1 As shown, the method for detecting the quality of the mitochondrial nutrient goat milk powder comprises the following steps: Step S1: obtaining a test sample, obtaining a plurality of first spectral images of the test sample through an imaging unit, randomly selecting M pixels at different positions in the plurality of first spectral images, and preprocessing the initial spectral images in the M pixels to obtain M second spectral images; Specifically, the detection sample is placed in the detection container and stirred in different directions according to the preset time intervals, so as to ensure the uniformity of the detection sample, and the first spectral image is collected by the imaging unit in the interval between two stirrings. The imaging unit is a hyperspectral camera, and the first spectral image is a hyperspectral image. Each pixel in the first spectral image corresponds to a spectral image formed by reflection of light of different wavelengths by each component in the detection sample, namely, the target spectral image. The light of different wavelengths is near-infrared light, and M pixels are randomly selected from different positions in the plurality of first spectral images as target pixels, so that The initial spectrum image corresponding to the target pixel is closest to the real spectrum image of the detection sample. Since the reflectance data of light of different wavelengths are superimposed in each target pixel to form a complete spectrum curve, in order to filter out the noise in the spectrum curve and obtain a more accurate spectrum curve in the target pixel, the reflectance data of light of different wavelengths in the target pixel are first sorted according to the wavelength, wherein the reflectance data of light of different wavelengths are selected at preset wavelength intervals, and the light of different wavelengths is the light wave related to the detection object of the detection sample, and the reflectance data obtained are also formed into the spectrum data sequence, and a sliding window of preset size is used from the top to the bottom. The sliding window starts from the starting position of the spectral data sequence. Since the reflectivity of the same material to light of different wavelengths is different, but for light waves with close wavelengths, the reflectivity is also close. Therefore, the reflectivity of the light waves in the sliding window is also close. By selecting N minimum reflectivity data in the sliding window, and taking the average of the N minimum reflectivity data as the reflectivity data of the wavelength corresponding to the middle position of the sliding window, the moving step length of the sliding window is 1 reflectivity data, and the denoising of the reflectivity data other than the head and tail reflectivity data in the spectral data sequence is achieved. When the head of the spectral data sequence is smaller than the sliding window, the denoising of the reflectivity data of the head and tail is realized. When the number of data at the 1 / 2 position and the remaining data to be processed is less than the length of the sliding window, when the sliding window is 5, that is, the first and second reflectivity data and the last, second, third and fourth reflectivity data of the spectral data sequence cannot be corrected by the sliding window, and therefore the uncorrected reflectivity data is used as the data to be processed, and the data to be processed is compared with at least two adjacent and continuous reflectivity data, and the data to be processed is obtained and corrected according to the maximum comparison result. Through the technical solution, the initial spectral image can be accurately corrected, laying a foundation for obtaining an accurate spectral image to be detected in the target pixel.

[0016] Step S2: acquiring a spectrum image to be detected based on the M second spectrum images, and comparing the spectrum image to be detected with a standard spectrum image to obtain a comparison result, and judging whether the detection sample is qualified according to the comparison result; Specifically, the spectral image to be detected is obtained by calculating the mean of the M second spectral images mentioned above, and the spectral image to be detected and the standard spectral image are placed in the same coordinate system for comparison, and a comparison result is obtained, wherein the standard spectral image is the spectral image corresponding to the mitochondrial nutrient goat milk powder standard, that is, the spectral image of the test sample that meets the detection standard, and the maximum difference between the spectral image to be detected corresponding to the main band corresponding to the test object, i.e., the test component, and the standard spectral image is obtained through the comparison result. When the maximum difference is less than the second threshold, it is considered that the difference between the two is small, and the corresponding test sample is qualified. On the contrary, when the maximum difference is greater than the second threshold, that is, the reflectivity corresponding to at least one wavelength of light is greater than the second threshold, that is, the concentration of the corresponding at least one test object is larger than the standard concentration. Therefore, it is considered that the test sample is unqualified. Through the technical solution, it is possible to accurately judge whether the test sample is qualified, which lays a foundation for further judging the concentration of the unqualified test object, i.e., the component.

[0017] Step S3: when the test sample is unqualified, based on the comparison result, a target band whose reflectance difference between the spectral image to be tested and the standard spectral image is greater than a second threshold is obtained, a first object is obtained according to the spectral feature corresponding to the target detection object of the test sample and the target band, and concentration information of the first object is obtained according to the first object and the first model; Specifically, when the above-mentioned detection sample is unqualified, through the above-mentioned comparison result, the target band in which the reflectance difference between the above-mentioned spectral image to be detected and the above-mentioned standard spectral image corresponding to the same wavelength of light is greater than the second threshold value is obtained, that is, the reflectance of the corresponding wavelength light in the above-mentioned target band may be the wavelength of the main reflected light corresponding to the substandard target detection object, and the spectral characteristics of the above-mentioned target detection object corresponding to the above-mentioned detection sample, that is, the main reflected wave wavelength corresponding to the target detection component, that is, the wavelength of the light wave with a larger reflectance corresponding to the above-mentioned target detection component, because there is more than one main reflected wave corresponding to the same above-mentioned target detection object, and the main reflected waves between different above-mentioned target detection objects may overlap, therefore, the spectral characteristics of each above-mentioned target detection object are firstly obtained, and the above-mentioned spectral characteristics are The wavelength information of the main reflected wave corresponding to the above-mentioned target detection object is obtained, and the light wave corresponding to the only above-mentioned target detection object in the above-mentioned target band is obtained, that is, the spectral characteristics of only one target detection object include the above-mentioned first sub-target band in the above-mentioned target band, and the above-mentioned target detection object is taken as the first object, and the first sub-image in the above-mentioned spectral image to be detected corresponding to the above-mentioned first sub-target band is input into the above-mentioned first model to obtain the concentration information of the above-mentioned first object, wherein the above-mentioned first model is a machine learning model trained for the above-mentioned first object and the corresponding different spectral images through learning data. Through the above-mentioned technical solution, the concentration information of the above-mentioned first object can be accurately obtained, and a foundation is laid for further obtaining the concentration information of other unqualified target detection objects.

[0018] Step S4: acquiring the concentration information of each target detection object corresponding to the target band according to the spectral characteristics of each target detection object in the target band, the first object, the concentration information of the first object and the second model.

[0019] Specifically, the remaining second target sub-band is obtained by removing the first target sub-band in the target band. Since the concentration information of the first object is known, the second target sub-band corresponding to the second object in the target detection object that only overlaps with the main reflection band of the first object is obtained through the spectral characteristics of each of the target detection objects. The third sub-image in the spectral image to be detected corresponding to the main reflection band overlapping the second object and the first object is also obtained. Since the concentrations of the first object and the first object are known, the third target sub-band, the second object, the third sub-image, and the concentrations of the first object and the first object are input into the second model to obtain the concentration information of the second object. The second model is a machine learning model trained by using the spectral images obtained by mixing different target detection objects according to different concentration ratios and the concentrations of the target detection objects as training data. Therefore, by inputting the above parameters into the second model, the concentration information of the second object can be obtained. Similarly, by obtaining the concentration information of other target detection objects corresponding to the target band, the concentration information of each target detection object corresponding to the target band can be accurately obtained through the above technical solution.

[0020] Furthermore, the step S1 comprises the following steps: Step S11: obtaining the mitochondrial goat milk powder sample to be tested as the test sample, and placing the test sample into the test container, wherein a stirring device is provided in the test container; Step S12: stirring the sample in different directions by the stirring device at the preset time interval, and acquiring a plurality of the first spectral images of the sample by the imaging unit during the time interval when the stirring is stopped; Step S13: randomly selecting M pixels at different positions from the plurality of first spectral images as target pixels, and obtaining an initial spectral image corresponding to each of the target pixels, and preprocessing the initial spectral image, and obtaining M second spectral images.

[0021] Specifically, the detection sample is placed in the detection container and stirred in different directions according to the preset time interval, so as to ensure the uniformity of the detection sample, and the first spectral image is collected by the imaging unit in the interval time between two stirrings, the imaging unit is a hyperspectral camera, the first spectral image is a hyperspectral image, each pixel in the first spectral image corresponds to a spectral image formed by reflection of light of different wavelengths by each component in the detection sample, the light of different wavelengths is near-infrared light, and a plurality of pixels are randomly selected from different positions in the plurality of first spectral images as the target pixels, so that the initial spectral image corresponding to the target pixel is closest to the real spectral image of the detection sample, and the initial spectral image corresponding to the detection sample by the target pixel is preprocessed to obtain the second spectral image, wherein the preprocessing is denoising. Through the technical solution, not only the most representative initial spectral image corresponding to the target pixel can be obtained, but also a more accurate second spectral image can be obtained by preprocessing the initial spectral image, so as to lay a foundation for further obtaining the component content of the detection sample through the second spectral image.

[0022] Furthermore, in step S1, preprocessing the spectral image includes: Step S130: obtaining reflectance data of light of different wavelengths in each of the target pixels, and sorting the reflectance data of light of different wavelengths from short to long according to wavelength to obtain a spectral data sequence; Step S131: sliding a sliding window of a preset size from the starting position of the spectral data sequence, selecting N minimum reflectance data in the sliding window, obtaining an average value of the N minimum reflectance data, and replacing the reflectance data of the wavelength at the center position of the sliding window with the average value; Step 132: Slide the sliding window with a sliding step of 1, and repeat the method of step S131 to correct the reflectivity data corresponding to the center position of the sliding window, and repeat this step until the amount of remaining reflectivity data is less than the size of the sliding window.

[0023] Specifically, since reflectivity data of light of different wavelengths are superimposed in each of the above-mentioned target pixels and form a complete spectral curve, in order to filter out noise in the above-mentioned spectral curve and obtain a more accurate spectral curve in the above-mentioned target pixel, the reflectivity data of light of different wavelengths in the above-mentioned target pixel are first sorted according to wavelength, wherein the reflectivity data of light of different wavelengths are selected at preset wavelength intervals, and the light of different wavelengths is a light wave related to the detection object of the above-mentioned detection sample, and the acquired reflectivity data are also formed into the above-mentioned spectral data sequence, and a sliding window of a preset size is slid from the starting position of the above-mentioned spectral data sequence, wherein the preset size of the above-mentioned sliding window is 5. Since the reflectivity of the same substance to light of different wavelengths is different, but for wavelengths that are closer, the reflectivity data is sorted according to the wavelength. The reflectivity of the light waves that are close is also close, therefore, the reflectivity of the light waves in the sliding window is also close, by selecting N minimum reflectivity data in the sliding window, wherein the value of N is less than or equal to the size of the sliding window, and taking the average of the N minimum reflectivity data as the reflectivity data of the wavelength corresponding to the middle position of the sliding window, the moving step of the sliding window is 1 reflectivity data, and by repeating the step S131, the denoising of the reflectivity data other than the head and tail reflectivity data in the spectral data sequence is achieved. Through the technical solution, when a noise peak appears at the center position of the sliding window, denoising can be effectively performed, so as to obtain a more accurate spectral curve in the target pixel.

[0024] Furthermore, in step S1, preprocessing the spectral image further includes: When the number of the reflectance data remaining at the head of the spectral data sequence is less than 1 / 2 of the sliding window and the number of the reflectance data remaining at the tail of the spectral data sequence is less than the size of the sliding window, the reflectance data is used as the data to be processed, and each of the data to be processed is compared with at least two of its consecutive adjacent reflectance data to obtain a maximum comparison result. When the maximum comparison result is less than or equal to a first threshold, the data to be processed does not need to be corrected. When the maximum comparison result is greater than the first threshold, the data to be processed and its at least two consecutive adjacent reflectance data are averaged and the obtained average replaces the data to be processed.

[0025] Specifically, when the head of the spectral data sequence is smaller than 1 / 2 of the sliding window, when the sliding window is 5, that is, the first and second reflectivity data and the last, second, third and fourth reflectivity data of the spectral data sequence cannot be corrected by the sliding window, and therefore the uncorrected reflectivity data is used as the data to be processed, and the data to be processed is compared with at least two adjacent and continuous reflectivity data, for example: the first data to be processed needs to be compared with the second and third reflectivity data, the second data to be processed needs to be compared with the first corrected data to be processed and the third reflectivity data, and a first comparison result and a second comparison result are obtained. , and the larger one of the first comparison result and the second comparison result is taken as the maximum comparison result. When the maximum comparison result is less than or equal to the first threshold, it means that the difference between the three is not large, and it can be determined that the reflectivity data at the position does not introduce noise. Therefore, the data to be processed at the position does not need to be processed. On the contrary, when the maximum comparison result is greater than the first threshold, the position may introduce noise. Therefore, the data to be processed and at least two of the reflectivity data adjacent to it are averaged and the average result replaces the data to be processed. Through the technical solution, the data to be processed that has not been denoised can be accurately corrected, laying a foundation for obtaining the spectral curve in the target pixel.

[0026] Furthermore, the step S2 comprises: Step S21: Calculate the mean of the M second spectral images to obtain the spectral image to be detected, and compare the spectral image to be detected with the standard spectral image in the same coordinate system to obtain the comparison result, wherein the standard spectral image is the spectral image corresponding to the detection sample that meets the detection standard; Step S22: When the comparison result is that the maximum difference in corresponding reflectance between the to-be-detected spectral image and the standard spectral image in the same band is less than or equal to a second threshold, the detection sample is qualified; otherwise, the detection sample is unqualified.

[0027] Specifically, the spectral image to be detected is obtained by calculating the mean of the M second spectral images mentioned above, and the spectral image to be detected and the standard spectral image are placed in the same coordinate system for comparison, and a comparison result is obtained, wherein the standard spectral image is the spectral image corresponding to the mitochondrial nutrient goat milk powder standard, that is, the spectral image of the test sample that meets the detection standard, and the maximum difference between the spectral image to be detected corresponding to the main band corresponding to the test object, i.e., the test component, and the standard spectral image is obtained through the comparison result. When the maximum difference is less than the second threshold, it is considered that the difference between the two is small, and the corresponding test sample is qualified. On the contrary, when the maximum difference is greater than the second threshold, that is, the reflectivity corresponding to at least one wavelength of light is greater than the second threshold, that is, the concentration of the corresponding at least one test object is larger than the standard concentration. Therefore, it is considered that the test sample is unqualified. Through the technical solution, it is possible to accurately judge whether the test sample is qualified, which lays a foundation for further judging the concentration of the unqualified test object, i.e., the component.

[0028] Furthermore, the step S3 comprises: Step S31: when the test sample is unqualified, obtaining, through the comparison result, a target band in which the difference in reflectance between the standard spectrum image and the spectrum image to be tested corresponding to the same wavelength of light is greater than a second threshold; Step S32: Obtain the spectral characteristics of the target detection object corresponding to the detection sample, and based on the spectral characteristics, obtain the first target sub-band in the target band corresponding to the unique target detection object, and take the target detection object as the first object, and input the first sub-image in the spectral image to be detected corresponding to the first target sub-band and the first object into the first model to obtain the concentration of the first object.

[0029] Specifically, when the above-mentioned detection sample is unqualified, through the above-mentioned comparison result, the target band in which the reflectance difference between the above-mentioned spectral image to be detected and the above-mentioned standard spectral image corresponding to the same wavelength of light is greater than the second threshold value is obtained, that is, the reflectance of the corresponding wavelength light in the above-mentioned target band may be the wavelength of the main reflected light corresponding to the substandard target detection object, and the spectral characteristics of the above-mentioned target detection object corresponding to the above-mentioned detection sample, that is, the main reflected wave wavelength corresponding to the target detection component, that is, the wavelength of the light wave with a larger reflectance corresponding to the above-mentioned target detection component, because there is more than one main reflected wave corresponding to the same above-mentioned target detection object, and the main reflected waves between different above-mentioned target detection objects may overlap, therefore, the spectral characteristics of each above-mentioned target detection object are firstly obtained, and the above-mentioned spectral characteristics are The wavelength information of the main reflected wave corresponding to the above-mentioned target detection object is obtained, and the light wave corresponding to the only above-mentioned target detection object in the above-mentioned target band is obtained, that is, the spectral characteristics of only one target detection object include the above-mentioned first sub-target band in the above-mentioned target band, and the above-mentioned target detection object is taken as the first object, and the first sub-image in the above-mentioned spectral image to be detected corresponding to the above-mentioned first sub-target band is input into the above-mentioned first model to obtain the concentration information of the above-mentioned first object, wherein the above-mentioned first model is a machine learning model trained for the above-mentioned first object and the corresponding different spectral images through learning data. Through the above-mentioned technical solution, the concentration information of the above-mentioned first object can be accurately obtained, and a foundation is laid for further obtaining the concentration information of other unqualified target detection objects.

[0030] Furthermore, the step S4 comprises: Step S41: the remaining band of the target band minus the first target sub-band corresponding to the first object is used as the second target sub-band, and according to the spectral characteristics of each target detection object, the second target sub-band corresponds to the second object in the target detection object that only overlaps with the main reflection band of the first object, and the third target sub-band in the second target sub-band where the main reflection band of the first object and the second object overlap is obtained, corresponding to the third sub-image in the spectral image to be detected; Step S42: inputting the third target sub-band, the first object and the concentration information of the first object, the second object and the third sub-image into the second model to obtain the concentration information of the second object; Step S43: Repeat the method of step S41 and step S42 to obtain the concentration information of each target detection object corresponding to the target band.

[0031] Specifically, the remaining second target sub-band is obtained by removing the first target sub-band from the target band. Since the concentration information of the first object is known, the second target sub-band corresponding to the second object in the target detection object that only overlaps with the main reflection band of the first object is obtained through the spectral characteristics of each target detection object. The third sub-image in the spectral image to be detected corresponding to the main reflection band overlapping the second object and the first object is also obtained. Since the concentrations of the first object and the first object are known, the third target sub-band, the second object, the third sub-image, and the concentrations of the first object and the first object are input into the second model to obtain the concentration information of the second object. The second model is a machine learning model that is trained by using the spectral images obtained by mixing different target detection objects according to different concentration ratios and the concentrations of the target detection objects as training data. Therefore, by inputting the above parameters into the above-mentioned second model, the concentration information of the above-mentioned second object can be obtained. Similarly, by repeating the above-mentioned steps S41 and S42, the concentration information of the fourth object in the remaining fourth target sub-band after removing the above-mentioned third target sub-band from the above-mentioned second target sub-band, which only overlaps with the main reflection band of the above-mentioned second object or the first object and the second object, can be obtained, and until the concentration information of all the above-mentioned target detection objects corresponding to the above-mentioned target band is obtained, through the above-mentioned technical solution, the concentration information of the above-mentioned target band corresponding to each of the above-mentioned target detection objects can be accurately obtained.

[0032] Furthermore, the second model is a machine learning model trained using spectral images obtained by mixing different numbers of the target detection objects in different concentration ratios, the target detection objects and the concentration information of the target detection objects as training data.

[0033] Specifically, different target detection objects are mixed according to different concentration ratios and corresponding spectral images are obtained, the spectral images and the concentration information of each target detection object are used as the training data, and the machine learning model is trained with the training data to obtain the second model. The concentration information of the target detection object can be accurately obtained by inputting the spectral image to be analyzed and the target detection object corresponding to the spectral image into the second model. In order to further improve the output accuracy of the second model, the concentration of the target detection object with known concentration in the analyzed spectral image can also be input. Through the above technical solution, the concentration information of the target detection object whose main reflection band overlaps in the target band can be accurately obtained.

[0034] Furthermore, the first spectral image and the second spectral image are images with reflectivity as the y-axis and wavelength as the x-axis.

[0035] In summary, the present invention randomly selects M pixels from different positions in the plurality of first spectral images as target pixels. Since each of the target pixels is superimposed with reflectance data of light of different wavelengths and forms a complete spectral curve, in order to filter out the noise in the spectral curve, a spectral data sequence is firstly acquired, and a sliding window of a preset size is used to slide from the starting position of the spectral data sequence. N minimum reflectance data values ​​are selected in the sliding window, and the average of the N minimum reflectance data values ​​is used as the reflectance data of the wavelength corresponding to the middle position of the sliding window. When the head of the spectral data sequence is smaller than 1 / 2 of the sliding window and the number of remaining data to be processed is smaller than the length of the sliding window, the data to be processed is compared with at least two adjacent and continuous reflectance data, and the data to be processed is acquired and corrected according to the maximum comparison result. Thereby, correction of each of the above-mentioned spectral data is achieved, and the above-mentioned spectral image to be detected and the above-mentioned standard spectral image are obtained and placed in the same coordinate system for comparison, and the comparison result is obtained to determine whether the above-mentioned test sample is qualified. When it is unqualified, the target band in which the reflectivity difference between the above-mentioned spectral image to be detected and the above-mentioned standard spectral image corresponding to the same wavelength of light is greater than the second threshold is obtained, and the first object and the concentration information of the first object are obtained. The concentration information of the second object is also obtained based on the second object and the corresponding second target sub-band and the first object, the first object concentration information and the second model. Similarly, the concentration information of each of the above-mentioned target detection objects in the above-mentioned target band is obtained. Through the mutual cooperation of the above-mentioned technical solutions, not only the quality inspection results of the above-mentioned test samples can be obtained, but also the concentration information of each unqualified target detection object can be accurately obtained, so as to facilitate the adjustment of production information according to the concentration information of the unqualified target detection objects.

[0036] The technical features of the above-mentioned embodiments can be combined arbitrarily. In order to make the description concise, not all possible combinations of the technical features in the above-mentioned embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0037] The above-mentioned embodiments only express several implementation methods of the present invention, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the patent of the present invention. It should be pointed out that, for ordinary technicians in this field, several variations and improvements can be made without departing from the concept of the present invention, and these all belong to the protection scope of the present invention. Therefore, the protection scope of the patent of the present invention shall be subject to the attached claims.

[0038] The above are only preferred embodiments of the present invention and are not intended to limit the present invention. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the protection scope of the present invention.

Claims

1. A quality detection method for mitochondrial nutrient goat milk powder based on image processing, characterized in that: For detecting the quality of the mitochondrial nutrient goat milk powder, the method comprises the following steps: Step S1: obtaining a test sample, obtaining a plurality of first spectral images of the test sample through an imaging unit, randomly selecting M pixels at different positions in the plurality of first spectral images, and preprocessing the initial spectral images in the M pixels to obtain M second spectral images; Step S2: acquiring a spectrum image to be detected based on the M second spectrum images, and comparing the spectrum image to be detected with a standard spectrum image to obtain a comparison result, and judging whether the detection sample is qualified according to the comparison result; Step S3: when the test sample is unqualified, based on the comparison result, a target band whose reflectance difference between the spectral image to be tested and the standard spectral image is greater than a second threshold is obtained, a first object is obtained according to the spectral feature corresponding to the target detection object of the test sample and the target band, and concentration information of the first object is obtained according to the first object and the first model; Step S4: acquiring the concentration information of each target detection object corresponding to the target band according to the spectral characteristics of each target detection object in the target band, the first object, the concentration information of the first object and the second model.

2. The method according to claim 1, characterized in that The step S1 comprises the following steps: Step S11: obtaining a mitochondrial goat milk powder sample to be tested as the test sample, and placing the test sample into a test container, wherein a stirring device is provided in the test container; Step S12: stirring the sample in different directions by the stirring device at preset time intervals, and acquiring a plurality of the first spectral images of the sample by the imaging unit during the time interval when the stirring is stopped; Step S13: randomly selecting M pixels at different positions from the plurality of first spectral images as target pixels, and obtaining an initial spectral image corresponding to each of the target pixels, and preprocessing the initial spectral image, and obtaining M second spectral images.

3. The method according to claim 1, characterized in that In the step S1, preprocessing the initial spectral image includes: Step S130: obtaining reflectance data of light of different wavelengths in each of the initial spectrum graphs, and sorting the reflectance data of light of different wavelengths from short to long according to wavelength to obtain a spectrum data sequence; Step S131: sliding a sliding window of a preset size from the starting position of the spectral data sequence, selecting N minimum reflectance data in the sliding window, obtaining an average value of the N minimum reflectance data, and replacing the reflectance data corresponding to the center position of the sliding window with the average value; Step 132: Slide the sliding window with a sliding step of 1, and repeat the method of step S131 to correct the reflectivity data corresponding to the center position of the sliding window, and repeat this step until the amount of remaining reflectivity data is less than the size of the sliding window.

4. The method according to claim 3, characterized in that In the step S1, preprocessing the initial spectral image further includes: When the number of the reflectance data remaining at the head of the spectral data sequence is less than 1 / 2 of the sliding window and the number of the reflectance data remaining at the tail of the spectral data sequence is less than the size of the sliding window, the reflectance data is used as the data to be processed, and each of the data to be processed is compared with at least two of its consecutive adjacent reflectance data to obtain a maximum comparison result. When the maximum comparison result is less than or equal to a first threshold, the data to be processed does not need to be corrected. When the maximum comparison result is greater than the first threshold, the data to be processed and its at least two consecutive adjacent reflectance data are averaged and the obtained average replaces the data to be processed.

5. The method according to claim 1, characterized in that The step S2 comprises: Step S21: Calculate the mean of the M second spectral images to obtain the spectral image to be detected, and compare the spectral image to be detected with the standard spectral image in the same coordinate system to obtain the comparison result, wherein the standard spectral image is the spectral image corresponding to the detection sample that meets the detection standard; Step S22: When the comparison result is that the maximum difference in the corresponding reflectances of the to-be-detected spectral image and the standard spectral image in the same band is less than or equal to a second threshold, the detection sample is qualified; otherwise, the detection sample is unqualified.

6. The method according to claim 1, characterized in that The step S3 comprises: Step S31: when the test sample is unqualified, obtaining, through the comparison result, a target band in which the difference in reflectance between the standard spectrum image and the spectrum image to be tested corresponding to the same wavelength of light is greater than a second threshold; Step S32: Obtain the spectral characteristics of the target detection object corresponding to the detection sample, and based on the spectral characteristics, obtain the first target sub-band in the target band corresponding to the unique target detection object, and take the target detection object as the first object, and input the first sub-image in the spectral image to be detected corresponding to the first target sub-band and the first object into the first model to obtain the concentration of the first object.

7. The method according to claim 1, characterized in that The step S4 comprises: Step S41: taking the remaining band of the target band minus the first target sub-band corresponding to the first object as the second target sub-band, obtaining the second target sub-band corresponding to the second object in the target detection object that only overlaps with the main reflection band of the first object according to the spectral characteristics of each target detection object, and obtaining the third target sub-band in the second target sub-band where the main reflection band of the first object and the second object overlap, corresponding to the third sub-image in the spectral image to be detected; Step S42: inputting the third target sub-band, the first object and the concentration information of the first object, the second object and the third sub-image into the second model to obtain the concentration information of the second object; Step S43: Repeat the method of step S41 and step S42 to obtain the concentration information of each target detection object corresponding to the target band.

8. The method according to claim 1, characterized in that The second model is a machine learning model trained using spectral images obtained by mixing different numbers of the target detection objects in different concentration ratios, the target detection objects and the concentration information of the target detection objects as training data.

9. The method according to claim 1, characterized in that: The first spectral image and the second spectral image are images with reflectance as the y-axis and wavelength as the x-axis.

Citation Information

Patent Citations

  • A quality inspection system for traditional Chinese medicine based on image recognition

    CN118674954B

  • System and method for detection of gas in the atmosphere from a multispectral image

    US20240265673A1

  • Method and device for quickly judging dry matters of fruits on trees

    CN114062282A

  • Hyperspectral image detection method for mutton quality indexes

    CN117929294A

  • Bamboo shoot quality detection method and system based on hyperspectral image and medium

    CN119147480A