CN111008970A - Hyperspectral image acquisition system-based method for detecting impurities in preserved vegetables - Google Patents

Hyperspectral image acquisition system-based method for detecting impurities in preserved vegetables Download PDF

Info

Publication number
CN111008970A
CN111008970A CN201911267095.2A CN201911267095A CN111008970A CN 111008970 A CN111008970 A CN 111008970A CN 201911267095 A CN201911267095 A CN 201911267095A CN 111008970 A CN111008970 A CN 111008970A
Authority
CN
China
Prior art keywords
coral
hyperspectral image
sample
pixel point
image
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201911267095.2A
Other languages
Chinese (zh)
Other versions
CN111008970B (en
Inventor
黄敏
李明泽
张慜
王玉川
朱启兵
郭亚
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Jiangnan University
Original Assignee
Jiangnan University
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Jiangnan University filed Critical Jiangnan University
Priority to CN201911267095.2A priority Critical patent/CN111008970B/en
Publication of CN111008970A publication Critical patent/CN111008970A/en
Application granted granted Critical
Publication of CN111008970B publication Critical patent/CN111008970B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/0002Inspection of images, e.g. flaw detection
    • G06T7/0004Industrial image inspection
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/24Classification techniques
    • G06F18/241Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches
    • G06F18/2411Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches based on the proximity to a decision surface, e.g. support vector machines
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/045Combinations of networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods
    • G06N3/084Backpropagation, e.g. using gradient descent
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/11Region-based segmentation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/136Segmentation; Edge detection involving thresholding
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/30Subject of image; Context of image processing
    • G06T2207/30108Industrial image inspection
    • G06T2207/30128Food products
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02ATECHNOLOGIES FOR ADAPTATION TO CLIMATE CHANGE
    • Y02A40/00Adaptation technologies in agriculture, forestry, livestock or agroalimentary production
    • Y02A40/90Adaptation technologies in agriculture, forestry, livestock or agroalimentary production in food processing or handling, e.g. food conservation

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Data Mining & Analysis (AREA)
  • General Engineering & Computer Science (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Evolutionary Computation (AREA)
  • Artificial Intelligence (AREA)
  • Health & Medical Sciences (AREA)
  • General Health & Medical Sciences (AREA)
  • Software Systems (AREA)
  • Mathematical Physics (AREA)
  • Biomedical Technology (AREA)
  • Biophysics (AREA)
  • Computational Linguistics (AREA)
  • Computing Systems (AREA)
  • Molecular Biology (AREA)
  • Evolutionary Biology (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Quality & Reliability (AREA)
  • Investigating Or Analysing Materials By Optical Means (AREA)

Abstract

The invention discloses a method for detecting impurities in dried pickled mustard tuber products based on a hyperspectral image acquisition system, which relates to the field of food nondestructive detection.

Description

Hyperspectral image acquisition system-based method for detecting impurities in preserved vegetables
Technical Field
The invention relates to the field of food nondestructive testing, in particular to a method for detecting impurities in preserved vegetables based on a hyperspectral image acquisition system.
Background
The preserved vegetable is a traditional fermented vegetable product in the south of China, has rich nutritional value, is rich in chemical components such as amino acid, vitamin and the like and various trace elements, and is beneficial to human bodies. With the improvement of the living standard of people, the food safety of the preserved vegetable is gradually valued by people. However, the processing of the dried pickled mustard tuber is still mainly the traditional household workshop production, and various impurities can be mixed in the dried pickled mustard tuber during the open-air production process. Although manual selection is carried out by people before food processing, the method is time-consuming, labor-consuming and poor in effect. Therefore, an advanced detection method is needed to be found for detecting the impurities in the preserved vegetables in a quick, low-cost and convenient way.
Disclosure of Invention
The invention provides a method for detecting impurities in preserved vegetables based on a hyperspectral image acquisition system aiming at the problems and the technical requirements, and the technical scheme of the invention is as follows:
a method for detecting impurities in dried preserved vegetables based on a hyperspectral image acquisition system comprises a control device and a shaking and dispersing device, a conveying device and a hyperspectral image acquisition device which are connected with the control device, wherein the method executed by the control device comprises the following steps:
the method comprises the steps of obtaining a dried plum sample and various impurity samples, scattering the samples by using a scattering device, conveying the samples by using a conveying device, and collecting a sample hyperspectral image of the samples in the movement process by using a hyperspectral image collection device, wherein the sample hyperspectral image comprises a hyperspectral image of the dried plum sample and hyperspectral images of various impurity samples;
performing data preprocessing on the sample hyperspectral images, extracting interested areas in each sample hyperspectral image, and extracting pixel point spectral data of each pixel point in each waveband in each interested area, wherein each interested area is an area where a sample in each sample hyperspectral image is located;
selecting a characteristic wave band for all extracted pixel point spectrum data by using a coral reef algorithm, extracting pixel point spectrum data of all pixel points in an interested area of a hyperspectral image of each sample under the characteristic wave band, and dividing the extracted pixel point spectrum data under all the characteristic wave bands into a training set and a test set to train so as to obtain an optimal classification model;
acquiring a hyperspectral image to be detected of the dried pickled mustard tuber product to be detected in the movement process by using a hyperspectral image acquisition system;
performing data preprocessing on the hyperspectral image to be detected, extracting an interested region in the hyperspectral image to be detected, acquiring pixel point spectral data of each pixel point of the interested region under a characteristic waveband, and inputting the pixel point spectral data into an optimal classification model to obtain a classification result of each pixel point;
and aggregating the pixel points according to the classification result of the pixel points to form an impurity area and marking the impurity area on the hyperspectral image to be detected.
The further technical scheme is that the method for preprocessing the sample hyperspectral images and extracting the interested areas in the sample hyperspectral images comprises the following steps:
performing black-and-white correction on the hyperspectral image of the sample to enable all spectral data to be between 0 and 1;
determining a distinguishing waveband according to each sample hyperspectral image, acquiring a background hyperspectral image of a background through a hyperspectral image acquisition device, and performing image correction on the sample hyperspectral image after black and white correction by using a waveband operation formula under the distinguishing waveband a, wherein the waveband operation formula under the distinguishing waveband a is I ═ Ia(i,j)-Ba(I, j), wherein I' is a sample hyperspectral image after black and white correction and image correction, Ia(i, j) is a gray scale image of the sample hyperspectral image after black and white correction under the different wave band a, Ba(i, j) is that the background hyperspectral image is in a distinct wave band aA lower gray scale image;
and performing background segmentation on the sample hyperspectral image subjected to black and white correction and image correction by using an image global threshold segmentation technology to remove the background, and extracting to obtain the region of interest in the sample hyperspectral image.
The further technical scheme is that the method for forming the impurity region by polymerizing the pixel points according to the classification result of the pixel points comprises the following steps:
setting the pixel point of the dried preserved vegetable as the classification result as 0, setting the pixel point of the impurity as 1, and reconstructing the hyperspectral image to be measured into a binary image;
removing noise points in the binary image by using a small connected domain removing operation;
and aggregating all the pixel points of which the classification results are impurities by using morphological expansion operation to obtain an impurity region.
The further technical scheme is that a coral reef algorithm is used for selecting a characteristic wave band, and the method comprises the following steps:
initializing parameters: the size of the coral reef grid is M × N, the length of each coral is the wave band number B, the wave band sequences are arranged in the coral reef grid, and the proportion of the initial coral occupying the total coral reef is rho0Broadcast spawning ratio in coral FbRatio of internal sexual hatching in coral 1-FbVegetative propagation ratio FaThe number of times that coral larvae try to occupy coral is k, the coral formation stage is with a certain probability PdThe unhealthy coral is predated at a ratio of FdNumber of generations, Ngen;
initializing a coral reef: creating coral reefs of size M N in proportion ρ0The coral reef is not repeatedly and randomly placed, and the number of the placed corals is M × N × ρ0Then calculating the health value of each coral through a self-defined health function;
coral broadcasting spawning: the number of coral broadcast spawning is M × N × ρ0*FbThe method is divided into two parts for random cross spawning, and the number of each part of coral is
Figure BDA0002313159090000031
In a specific step, two corals become parents only once, so the number of coral larvae generated by egg laying is M + N + rho0*FbAnd calculating the health value of the coral larvae;
sexual reproduction inside coral: the number of sexual reproduction in coral is M × N × ρ0*(1-Fb) The coral larvae are generated by random mutation of the hatching model, and the number of the coral larvae is M × N × ρ0*(1-Fb) And calculating the health value of the larva;
and (3) placing coral larvae: for broadcast spawning and hatching coral larvae, randomly trying to set each coral larva in a region of the coral reef, and if the region is empty, placing the coral larvae in the region for growth; if the area is already occupied by coral, then when the health value of coral larvae is higher than that of existing coral, coral larvae are grown in the area; defining k attempts to place coral larvae on a coral reef, after k unsuccessful attempts, determining that the coral larvae are destroyed by animals in the coral reef;
asexual propagation of coral: in the asexual reproduction modeling, all the corals existing in the coral reef are classified according to their health degree, and a part of them FaSelf-propagating and settling different parts of the coral reef according to a coral larva settling method;
coral stage predation: at k steps of each reproduction, the occupation ratio is FdUnhealthy coral with a low health value of (1) with a probability of (P)dIs predated, so that the free space is the next generation of coral reef;
and (4) finishing conditions: and (4) storing the coral data with the maximum health value in each generation until iteration is carried out to the preset generation number, wherein the spectrum wave band sequence with the maximum health value in the coral data stored in all the generations is a characteristic wave band.
The further technical scheme is that the method comprises the following steps of dividing the extracted pixel point spectral data under all characteristic wave bands into a training set and a testing set to train so as to obtain an optimal classification model, and comprises the following steps:
dividing the extracted pixel point spectrum data under all characteristic bands into a training set and a testing set, wherein the training set and the testing set respectively comprise pixel point spectrum data of pixel points corresponding to the dried pickled mustard tuber samples and pixel point spectrum data of pixel points corresponding to the impurity samples;
respectively establishing classification models of SVM and BPNN pixel grades through a training set;
evaluating the performance of the classification model by using the test set, wherein the performance comprises classification precision and prediction time;
and selecting the classification model with the optimal performance as the optimal classification model.
The beneficial technical effects of the invention are as follows:
the application discloses a method for detecting impurities in dried pickled mustard tuber products based on a hyperspectral image acquisition system, the method comprises the steps of acquiring hyperspectral images of dried pickled mustard tuber samples and different types of impurity samples under the condition of motion by using the hyperspectral image acquisition system, extracting pixel point spectral data in an area of interest, performing wave band selection by using a coral reef algorithm, establishing an optimal classification model by using the pixel point spectral data after the wave band selection, and realizing pixel-level classification detection on the hyperspectral images of the dried pickled mustard tuber products to be detected by using the optimal classification model, so that various types of impurities in the dried pickled mustard tuber products to be detected are automatically identified.
Drawings
Fig. 1 is a schematic partial structural diagram of a hyperspectral image acquisition system in the present application.
Fig. 2 is a flowchart of a method for detecting impurities in the preserved vegetable according to the present application.
FIG. 3 is a flow chart of the present application for determining characteristic bands using the coral reef algorithm.
Detailed Description
The following further describes the embodiments of the present invention with reference to the drawings.
The application discloses impurity detection method in dried pickled mustard tuber based on hyperspectral image acquisition system, the hyperspectral image acquisition system that this application used mainly includes controlling means and tremble scattered device, conveyor and hyperspectral image acquisition device that connect, wherein, tremble scattered the device and can adopt the shake motor to realize or adopt to turn and grab the realization for tremble the material and scatter and make its tiling on conveyor. Referring to fig. 1, the conveying device mainly includes a PLC controller and a conveyor belt 1, the control device 2 is connected to the PLC controller, and the PLC controller is connected to and drives the conveyor belt 1 to move to realize conveying. The hyperspectral image acquisition device mainly comprises a hyperspectral camera 3, a light source 4 and a light source controller 5, wherein the hyperspectral camera 3 is arranged towards a conveying belt 1, a control device 2 is connected with the hyperspectral camera 3, the light source 4 faces the conveying belt 1 and irradiates the shooting position of the hyperspectral camera 3, and the light source controller 5 is connected with the light source 4. The control device 2 is a part for centralized control and signal processing in the whole system, and the process of the impurity detection method in the preserved vegetables executed by the control device comprises the following steps, please refer to the flow chart shown in fig. 2:
1. and acquiring a hyperspectral image of the sample, wherein the hyperspectral image comprises a hyperspectral image of a dried pickled mustard tuber sample and a hyperspectral image of various impurity samples. Firstly, obtaining clean dried pickled mustard tuber samples and various impurity samples, then placing each obtained sample in a hyperspectral image acquisition system, and acquiring hyperspectral images of the samples in the motion process by using the hyperspectral image acquisition system: the shaking and scattering device is used for shaking and scattering the sample, then the sample is conveyed through the conveying device, and then the hyperspectral image of the sample in the movement process is collected through the hyperspectral image collection device.
2. The spectral data preprocessing comprises the following preprocessing modes:
and S1, performing black and white correction on the sample hyperspectral image to enable all spectral data to be between 0 and 1, thereby ensuring the stability of the spectral data.
S2, under certain wave bands, the dried pickled mustard tuber, impurities and the background are distinguished relatively obviously, and a distinguishing wave band a is determined according to the hyperspectral images of the samples, wherein the distinguishing wave band a is the wave band with the largest difference between the spectral data of the dried pickled mustard tuber/impurities and the background.
Then obtaining a background hyperspectral image only with a background, and performing image correction on the sample hyperspectral image after black and white correction by using the following band operation formula under a distinct band a:
I′=Ia(i,j)-Ba(i,j);
wherein I' is a sample hyperspectral image after black and white correction and image correction, Ia(i, j) is a gray scale image of the sample hyperspectral image after black and white correction under the distinct wave band a, Ba(i, j) is a gray level image of the background hyperspectral image under the distinct waveband a;
and S3, carrying out background segmentation to remove the background by utilizing the sample hyperspectral image after the image global threshold segmentation technology black-and-white correction and the image correction, and extracting to obtain the region of interest in the sample hyperspectral image, wherein the region of interest is the region where the sample in the sample hyperspectral image is located.
3. And acquiring pixel spectral data, and extracting pixel spectral data of each pixel of the region of interest of the hyperspectral image of each sample under each waveband.
4. Selecting a characteristic wave band: the coral reef algorithm, a new bio-element heuristic algorithm, is used to obtain a characteristic band of pixel hyperspectral data, please refer to the flowchart shown in fig. 3, which is specific:
s1, parameter initialization: the size of the coral reef grid is M × N, the length of each coral is the wave band number B, the wave band sequences are arranged in the coral reef grid, and the proportion of the initial coral occupying the total coral reef is rho0Broadcast spawning ratio in coral FbRatio of internal sexual hatching in coral 1-FbVegetative propagation ratio FaThe number of times that coral larvae try to occupy coral is k, the coral formation stage is with a certain probability PdThe unhealthy coral is predated at a ratio of FdNumber of generations, Ngen.
S2, coral reef initialization: creating coral reefs of size M N in proportion ρ0The coral reef is not repeatedly and randomly placed, and the number of the placed corals is M × N × ρ0And then calculating the health value of each coral through a customized health function.
S3, coral broadcast spawning: the number of coral broadcast spawning is M × N × ρ0*FbThe method is divided into two parts for random cross spawning, and the number of each part of coral is
Figure BDA0002313159090000051
In a specific step, two corals become parents only once, so the number of coral larvae generated by egg laying is M + N + rho0*FbAnd calculating the health value of the coral larvae.
S4, sexual reproduction inside coral: the number of sexual reproduction in coral is M × N × ρ0*(1-Fb) The coral larvae are generated by random mutation of the hatching model, and the number of the coral larvae is M × N × ρ0*(1-Fb) And calculating the health value of the larva.
S5, coral larva settling: whether by broadcast spawning or egg laying, once all the coral larvae are formed, they will try to settle and grow in the coral reef, since the health value of each coral larva is known, each coral larva is randomly tried to be set in an area of the coral reef, and if the area is empty (free space in the coral reef), the coral larvae are directly settled to grow in the area regardless of the health value. If the area is already occupied by coral, new coral larvae will be placed in the area to grow only if the health value of the coral larvae is higher than the existing coral in the area. Definition k attempts to place coral larvae on coral reefs, after k unsuccessful attempts, it was determined that the coral larvae were destroyed by the animals in the coral reefs.
S6, coral asexual propagation: in the asexual reproduction modeling, all the corals existing in the coral reef are classified according to their health degree, and a part of them FaSelf-reproduction was performed and settled down on different parts of the coral reef as per the coral larva settlement method shown in S5.
S7, coral stage predation: at k steps of each reproduction, a small number of corals may die, setting the occupancy ratio to FdUnhealthy coral with a low health value of (1) with a probability of (P)dIs predated, so that the free space is the next generation of coral reef;
s8, end condition: and (4) storing the coral data with the maximum health value in each generation until iteration is carried out to the preset generation number, wherein the spectrum wave band sequence with the maximum health value in the coral data stored in all the generations is a characteristic wave band.
For example, in one example of the present application, the parameters of the coral reef were initialized to: the size of the coral reef mesh is 10 × 10, the length of each coral is the number of bands B-300 (the band sequences are placed inside), and the proportion of the initial coral occupying the total coral reef is rho00.6, broadcast spawning ratio in coral Fb0.9, ratio of internally sexual hatching eggs in coral 1-Fb0.1, ratio of vegetative propagation Fa0.01, the number of times k that coral larvae try to occupy the coral is 5, the coral formation stage, with a certain probability Pd0.1 ratio F for unhealthy coral to be predatedd0.01, the number of generations, Ngen, 100. And according to the flow of the coral reef algorithm until iteration is carried out to the preset generation number, wherein the spectrum band sequence with the maximum health value in coral data stored in all the generations is the characteristic band.
5. And establishing an optimal classification model. And extracting pixel point spectrum data of each pixel point in the region of interest of the hyperspectral image of each sample under the characteristic wave band, and dividing the pixel point spectrum data into a training set and a testing set, wherein the training set and the testing set respectively comprise pixel point spectrum data of pixel points corresponding to the dried pickled mustard tuber samples and pixel point spectrum data of pixel points corresponding to the impurity samples. And respectively establishing classification models of SVM and BPNN pixel grades through the training set. And evaluating the performance of the classification model by using the test set, wherein the performance comprises classification precision and prediction time. And selecting the classification model with the optimal performance as the optimal classification model.
6. The impurity detection is carried out on the preserved vegetable product to be detected by utilizing the optimal classification model, and the method comprises the following steps:
and S1, acquiring the hyperspectral image to be detected of the dried preserved vegetable product to be detected in the motion process by using the hyperspectral image acquisition system, wherein the acquisition method is similar to the step 1 and is not repeated in the application.
S2, performing data preprocessing on the hyperspectral image to be detected, extracting an interested region in the hyperspectral image to be detected, and then acquiring pixel point spectral data of each pixel point of the interested region under a characteristic waveband, wherein the operation steps are similar to the steps 2 and 3, and are not repeated in the application.
And S3, inputting the extracted pixel point spectral data under the characteristic wave band into the optimal classification model to obtain a classification result of each pixel point, wherein the classification result is preserved vegetable or impurities.
And S4, setting the pixel point with the classification result of the dried pickled mustard tuber as 0, setting the pixel point with the classification result of the impurity as 1, and reconstructing the hyperspectral image to be measured into a binary image.
And S5, removing the small connected domain operation to remove the noise points in the binary image.
And S6, aggregating all the pixel points of which the classification results are impurities by using morphological expansion operation to obtain an impurity area, and identifying the impurity area on the hyperspectral image to be detected, thereby achieving the purpose of detecting the impurities in the dried preserved vegetable product to be detected. Meanwhile, the performance of the optimal classification model is evaluated by the impurity recognition rate and the average prediction time, so that the optimal classification model is continuously optimized in the detection process.
What has been described above is only a preferred embodiment of the present application, and the present invention is not limited to the above embodiment. It is to be understood that other modifications and variations directly derivable or suggested by those skilled in the art without departing from the spirit and concept of the present invention are to be considered as included within the scope of the present invention.

Claims (5)

1. A method for detecting impurities in dried preserved vegetables based on a hyperspectral image acquisition system is characterized in that the hyperspectral image acquisition system comprises a control device and a shaking and scattering device, a conveying device and a hyperspectral image acquisition device which are connected with the control device, and the method executed by the control device comprises the following steps:
acquiring a dried pickled mustard tuber sample and various impurity samples, scattering the samples by using the scattering device, then conveying the samples by using the conveying device, and acquiring a sample hyperspectral image of the samples in the movement process by using the hyperspectral image acquisition device, wherein the sample hyperspectral image comprises a hyperspectral image of the dried pickled mustard tuber sample and a hyperspectral image of various impurity samples;
performing data preprocessing on the sample hyperspectral images, extracting interested areas in each sample hyperspectral image, and extracting pixel point spectral data of each pixel point in each interested area under each wave band, wherein the interested areas are areas where samples in the sample hyperspectral images are located;
selecting a characteristic wave band for all extracted pixel point spectrum data by using a coral reef algorithm, extracting pixel point spectrum data of all pixel points in an interested area of a hyperspectral image of each sample under the characteristic wave band, and dividing the extracted pixel point spectrum data under all the characteristic wave bands into a training set and a test set to train so as to obtain an optimal classification model;
acquiring a hyperspectral image to be detected of the dried pickled mustard tuber product to be detected in the movement process by using the hyperspectral image acquisition system;
performing data preprocessing on the hyperspectral image to be detected, extracting an interested region in the hyperspectral image to be detected, acquiring pixel point spectral data of each pixel point of the interested region under the characteristic wave band, and inputting the pixel point spectral data into the optimal classification model to obtain a classification result of each pixel point;
and aggregating the pixel points according to the classification result of the pixel points to form an impurity area and marking the impurity area on the hyperspectral image to be detected.
2. The method according to claim 1, wherein the data preprocessing the sample hyperspectral images and extracting the region of interest in each sample hyperspectral image comprises:
performing black-and-white correction on the sample hyperspectral image to enable all spectral data to be between 0 and 1;
determining a distinguishing waveband according to each sample hyperspectral image, acquiring a background hyperspectral image of a background through the hyperspectral image acquisition device, and performing image correction on the sample hyperspectral image after black and white correction by using a waveband operation formula under the distinguishing waveband a, wherein the waveband operation formula under the distinguishing waveband a is I ═ Ia(i,j)-Ba(I, j) wherein I' is black and white corrected and image corrected sample highlightsSpectral image, Ia(i, j) is a gray scale image of the sample hyperspectral image after black and white correction under the distinct wave band a, Ba(i, j) is a gray level image of the background hyperspectral image under the distinct waveband a;
and performing background segmentation on the sample hyperspectral image subjected to black and white correction and image correction by using an image global threshold segmentation technology to remove the background, and extracting to obtain the region of interest in the sample hyperspectral image.
3. The method according to claim 1, wherein the aggregating pixel points to form an impurity region according to the classification result of the pixel points comprises:
setting the pixel point of the dried preserved vegetable as the classification result as 0, setting the pixel point of the impurity as 1, and reconstructing the hyperspectral image to be measured into a binary image;
removing noise points in the binary image by using a small connected domain removing operation;
and aggregating all the pixel points of which the classification results are impurities by using morphological expansion operation to obtain the impurity region.
4. A method as claimed in claim 1, wherein the selecting the characteristic band using the coral reef algorithm comprises:
initializing parameters: the size of the coral reef grid is M × N, the length of each coral is the wave band number B, the wave band sequences are arranged in the coral reef grid, and the proportion of the initial coral occupying the total coral reef is rho0Broadcast spawning ratio in coral FbRatio of internal sexual hatching in coral 1-FbVegetative propagation ratio FaThe number of times that coral larvae try to occupy coral is k, the coral formation stage is with a certain probability PdThe unhealthy coral is predated at a ratio of FdNumber of generations, Ngen;
initializing a coral reef: creating coral reefs of size M N in proportion ρ0The coral reef is not repeatedly and randomly placed, and the number of the placed corals is M × N × ρ0Then through customized healthCalculating the health value of each coral by a function;
coral broadcasting spawning: the number of coral broadcast spawning is M × N × ρ0*FbThe method is divided into two parts for random cross spawning, and the number of each part of coral is
Figure FDA0002313159080000021
In a specific step, two corals become parents only once, so the number of coral larvae generated by egg laying is M + N + rho0*FbAnd calculating the health value of the coral larvae;
sexual reproduction inside coral: the number of sexual reproduction in coral is M × N × ρ0*(1-Fb) The coral larvae are generated by random mutation of the hatching model, and the number of the coral larvae is M × N × ρ0*(1-Fb) And calculating the health value of the larva;
and (3) placing coral larvae: for broadcast spawning and hatching coral larvae, randomly trying to set each coral larva to a region of the coral reef, if the region is empty, placing said coral larvae in said region for growth; if a region has been occupied by coral, installing the coral larvae in the region to grow when the health value of the coral larvae is higher than existing coral; defining k attempts to place coral larvae on a coral reef, after k unsuccessful attempts, determining that the coral larvae are destroyed by animals in the coral reef;
asexual propagation of coral: in the asexual reproduction modeling, all the corals existing in the coral reef are classified according to their health degree, and a part of them FaSelf-propagating and settling at different parts of the coral reef according to the coral larva settling method;
coral stage predation: at k steps of each reproduction, the occupation ratio is FdUnhealthy coral with a low health value of (1) with a probability of (P)dIs predated, so that the free space is the next generation of coral reef;
and (4) finishing conditions: and storing the coral data with the maximum health value in each generation until iteration is carried out to the preset generation number, wherein the spectrum wave band sequence with the maximum health value in the coral data stored in all the generations is the characteristic wave band.
5. The method according to any one of claims 1 to 4, wherein the step of obtaining the optimal classification model by classifying the extracted spectral data of the pixel points under all the characteristic bands into a training set and a test set comprises:
dividing the extracted pixel point spectrum data under all characteristic bands into a training set and a testing set, wherein the training set and the testing set respectively comprise pixel point spectrum data of pixel points corresponding to the dried pickled mustard tuber samples and pixel point spectrum data of pixel points corresponding to the impurity samples;
respectively establishing classification models of SVM and BPNN pixel grades through the training set;
evaluating the performance of the classification model by using the test set, wherein the performance comprises classification precision and prediction time;
and selecting the classification model with the optimal performance as the optimal classification model.
CN201911267095.2A 2019-12-11 2019-12-11 Hyperspectral image acquisition system-based method for detecting impurities in preserved vegetables Active CN111008970B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911267095.2A CN111008970B (en) 2019-12-11 2019-12-11 Hyperspectral image acquisition system-based method for detecting impurities in preserved vegetables

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911267095.2A CN111008970B (en) 2019-12-11 2019-12-11 Hyperspectral image acquisition system-based method for detecting impurities in preserved vegetables

Publications (2)

Publication Number Publication Date
CN111008970A true CN111008970A (en) 2020-04-14
CN111008970B CN111008970B (en) 2023-04-18

Family

ID=70114452

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911267095.2A Active CN111008970B (en) 2019-12-11 2019-12-11 Hyperspectral image acquisition system-based method for detecting impurities in preserved vegetables

Country Status (1)

Country Link
CN (1) CN111008970B (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112990028A (en) * 2021-03-22 2021-06-18 精英数智科技股份有限公司 Method for classifying coal and gangue based on classifier and gangue sorting device
CN113433076A (en) * 2021-05-18 2021-09-24 中国检验检疫科学研究院 Hyperspectral imaging technology-based method for identifying aflatoxin in corn seeds
CN114359539A (en) * 2022-03-17 2022-04-15 广东省农业科学院农业质量标准与监测技术研究所 Intelligent identification method for high-spectrum image of parasite in sashimi
WO2023000907A1 (en) * 2021-07-23 2023-01-26 奥比中光科技集团股份有限公司 Method and apparatus for determining spectral image, terminal, and storage medium
CN117074353A (en) * 2023-08-18 2023-11-17 广东省农业科学院设施农业研究所 Nondestructive detection method and system for litchi fruit Di-moths

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP2049213A2 (en) * 2006-08-04 2009-04-22 University of York Display systems
CN108446582A (en) * 2018-01-25 2018-08-24 西安电子科技大学 Hyperspectral image classification method based on textural characteristics and affine propagation clustering algorithm
CN109253975A (en) * 2018-11-08 2019-01-22 江南大学 Apple slight damage hyperspectral detection method based on MSC-CFS-ICA
CN110516668A (en) * 2019-08-16 2019-11-29 浙江理工大学 A kind of honey adulteration detection method and device based on high light spectrum image-forming technology

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP2049213A2 (en) * 2006-08-04 2009-04-22 University of York Display systems
CN108446582A (en) * 2018-01-25 2018-08-24 西安电子科技大学 Hyperspectral image classification method based on textural characteristics and affine propagation clustering algorithm
CN109253975A (en) * 2018-11-08 2019-01-22 江南大学 Apple slight damage hyperspectral detection method based on MSC-CFS-ICA
CN110516668A (en) * 2019-08-16 2019-11-29 浙江理工大学 A kind of honey adulteration detection method and device based on high light spectrum image-forming technology

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112990028A (en) * 2021-03-22 2021-06-18 精英数智科技股份有限公司 Method for classifying coal and gangue based on classifier and gangue sorting device
CN113433076A (en) * 2021-05-18 2021-09-24 中国检验检疫科学研究院 Hyperspectral imaging technology-based method for identifying aflatoxin in corn seeds
WO2023000907A1 (en) * 2021-07-23 2023-01-26 奥比中光科技集团股份有限公司 Method and apparatus for determining spectral image, terminal, and storage medium
CN114359539A (en) * 2022-03-17 2022-04-15 广东省农业科学院农业质量标准与监测技术研究所 Intelligent identification method for high-spectrum image of parasite in sashimi
US11727669B1 (en) 2022-03-17 2023-08-15 Institute of Facility Agriculture, Guangdong Academy of Agricultural Science Intelligent recognition method of hyperspectral image of parasites in raw fish
CN117074353A (en) * 2023-08-18 2023-11-17 广东省农业科学院设施农业研究所 Nondestructive detection method and system for litchi fruit Di-moths
CN117074353B (en) * 2023-08-18 2024-05-03 广东省农业科学院设施农业研究所 Nondestructive detection method and system for litchi fruit Di-moths

Also Published As

Publication number Publication date
CN111008970B (en) 2023-04-18

Similar Documents

Publication Publication Date Title
CN111008970B (en) Hyperspectral image acquisition system-based method for detecting impurities in preserved vegetables
Blasco et al. Automatic sorting of satsuma (Citrus unshiu) segments using computer vision and morphological features
Mahendran et al. Application of computer vision technique on sorting and grading of fruits and vegetables
CN101059425A (en) Method and device for identifying different variety green tea based on multiple spectrum image texture analysis
Carolina et al. Classification of oranges by maturity, using image processing techniques
Thinh et al. Mango classification system based on machine vision and artificial intelligence
Sung et al. Automatic grader for flatfishes using machine vision
CN116363505A (en) Target picking method based on picking robot vision system
Thong et al. Mango classification system uses image processing technology and artificial intelligence
CN104089925A (en) Hyperspectral imaging-based Target area extraction method for detecting shrimp quality
CN112676195B (en) Color sorting device and method for solid wood floor based on linear array CMOS camera
KR102596206B1 (en) Classification system of dried sea cucumber using image analysis
Manickavasagan et al. Computer vision technique to classify dates based on hardness
Sabanci et al. Weight estimation of wheat by using image processing techniques
CN102680488A (en) Device and method for identifying massive agricultural product on line on basis of PCA (Principal Component Analysis)
Thinh et al. Sorting and classification of mangoes based on artificial intelligence
CN116152718A (en) Intelligent observation device and method for prawn culture
EP4018180A1 (en) Devices, systems and methods for sorting and labelling food products
CN112816487B (en) Machine vision-based preserved egg internal quality nondestructive testing method
Septiarini et al. Classifying the swallow nest quality using support vector machine based on computer vision
Gila et al. Automatic classification of olives for oil production using computer vision
Micaraseth et al. Coffee Bean Inspection Machine with Deep Learning Classification
CN113588596A (en) Method and system for identifying and detecting content of animal source protein powder doped in fish meal
Hanibah et al. Determination of physical rice composition using image processing technique
Singh et al. Advances in computer vision technology for foods of animal and aquatic origin (a)

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant