CN111551499B - Method and device for measuring sugar content of fruit, computer equipment and storage medium - Google Patents

Method and device for measuring sugar content of fruit, computer equipment and storage medium Download PDF

Info

Publication number
CN111551499B
CN111551499B CN202010350875.XA CN202010350875A CN111551499B CN 111551499 B CN111551499 B CN 111551499B CN 202010350875 A CN202010350875 A CN 202010350875A CN 111551499 B CN111551499 B CN 111551499B
Authority
CN
China
Prior art keywords
fruit
sugar
picture data
preset size
data
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.)
Active
Application number
CN202010350875.XA
Other languages
Chinese (zh)
Other versions
CN111551499A (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.)
Agricultural Information Institute of CAAS
Original Assignee
Agricultural Information Institute of CAAS
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 Agricultural Information Institute of CAAS filed Critical Agricultural Information Institute of CAAS
Priority to CN202010350875.XA priority Critical patent/CN111551499B/en
Publication of CN111551499A publication Critical patent/CN111551499A/en
Application granted granted Critical
Publication of CN111551499B publication Critical patent/CN111551499B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G01MEASURING; TESTING
    • G01NINVESTIGATING OR ANALYSING MATERIALS BY DETERMINING THEIR CHEMICAL OR PHYSICAL PROPERTIES
    • G01N21/00Investigating or analysing materials by the use of optical means, i.e. using sub-millimetre waves, infrared, visible or ultraviolet light
    • G01N21/17Systems in which incident light is modified in accordance with the properties of the material investigated
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01NINVESTIGATING OR ANALYSING MATERIALS BY DETERMINING THEIR CHEMICAL OR PHYSICAL PROPERTIES
    • G01N21/00Investigating or analysing materials by the use of optical means, i.e. using sub-millimetre waves, infrared, visible or ultraviolet light
    • G01N21/84Systems specially adapted for particular applications
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/21Design or setup of recognition systems or techniques; Extraction of features in feature space; Blind source separation
    • G06F18/214Generating training patterns; Bootstrap methods, e.g. bagging or boosting
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V20/00Scenes; Scene-specific elements
    • G06V20/40Scenes; Scene-specific elements in video content
    • G06V20/41Higher-level, semantic clustering, classification or understanding of video scenes, e.g. detection, labelling or Markovian modelling of sport events or news items
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01NINVESTIGATING OR ANALYSING MATERIALS BY DETERMINING THEIR CHEMICAL OR PHYSICAL PROPERTIES
    • G01N21/00Investigating or analysing materials by the use of optical means, i.e. using sub-millimetre waves, infrared, visible or ultraviolet light
    • G01N21/17Systems in which incident light is modified in accordance with the properties of the material investigated
    • G01N2021/1765Method using an image detector and processing of image signal
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01NINVESTIGATING OR ANALYSING MATERIALS BY DETERMINING THEIR CHEMICAL OR PHYSICAL PROPERTIES
    • G01N21/00Investigating or analysing materials by the use of optical means, i.e. using sub-millimetre waves, infrared, visible or ultraviolet light
    • G01N21/84Systems specially adapted for particular applications
    • G01N2021/8466Investigation of vegetal material, e.g. leaves, plants, fruits
    • 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
    • Y02PCLIMATE CHANGE MITIGATION TECHNOLOGIES IN THE PRODUCTION OR PROCESSING OF GOODS
    • Y02P90/00Enabling technologies with a potential contribution to greenhouse gas [GHG] emissions mitigation
    • Y02P90/30Computing systems specially adapted for manufacturing

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Theoretical Computer Science (AREA)
  • Analytical Chemistry (AREA)
  • Health & Medical Sciences (AREA)
  • Pathology (AREA)
  • Immunology (AREA)
  • General Health & Medical Sciences (AREA)
  • Biochemistry (AREA)
  • Data Mining & Analysis (AREA)
  • Chemical & Material Sciences (AREA)
  • General Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Multimedia (AREA)
  • Computational Linguistics (AREA)
  • Artificial Intelligence (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Evolutionary Computation (AREA)
  • Evolutionary Biology (AREA)
  • Image Analysis (AREA)
  • Image Processing (AREA)

Abstract

The invention discloses a method, a device, computer equipment and a storage medium for measuring the sugar content of fruits, relates to the technical field of sugar content measurement, and is used for improving the efficiency of measuring the sugar content of fruits and avoiding the damage of fruits to be measured caused by sugar measurement. The main technical scheme of the invention is as follows: acquiring fruit picture data of fruits to be detected; inputting the fruit picture data into a fruit sugar estimation model to obtain sugar data corresponding to the fruit picture data; the sugar estimation model is obtained by training according to the picture data of the fruit samples and the corresponding sugar content; and determining the sugar content of the fruit to be detected according to the sugar data corresponding to the fruit picture data.

Description

Method and device for measuring sugar content of fruit, computer equipment and storage medium
Technical Field
The invention relates to the technical field of sugar content measurement, in particular to a method, a device, computer equipment and a storage medium for measuring the sugar content of fruits.
Background
Sugar content in fruits is an important index for measuring taste and quality of fruits. Currently, sugar content of fruits is measured mainly by a special sugar meter, but juice is required to be extracted from fruits to be measured by the sugar meter, and then the sugar content of the fruits to be measured is determined by measuring the sugar content of juice by the sugar meter. Therefore, the efficiency of measuring the sugar content of the fruit by the sugar meter is low, which may lead to breakage of the fruit to be measured.
Disclosure of Invention
The invention provides a method, a device, computer equipment and a storage medium for measuring the sugar content of fruits, which are used for improving the efficiency of measuring the sugar content of the fruits and avoiding the damage of fruits to be measured caused in the sugar measurement process.
The embodiment of the invention provides a method for measuring the sugar content of fruits, which comprises the following steps:
acquiring fruit picture data of fruits to be detected;
inputting the fruit picture data into a fruit sugar estimation model to obtain sugar data corresponding to the fruit picture data; the sugar estimation model is obtained by training according to the picture data of the fruit samples and the corresponding sugar content;
and determining the sugar content of the fruit to be detected according to the sugar data corresponding to the fruit picture data.
The embodiment of the invention provides a device for measuring the sugar content of fruits, which comprises the following components:
the acquisition module is used for acquiring fruit picture data of fruits to be detected;
the computing module is used for inputting the fruit picture data into a fruit sugar estimation model to obtain sugar data corresponding to the fruit picture data; the sugar estimation model is obtained by training according to the picture data of the fruit samples and the corresponding sugar content;
and the determining module is used for determining the sugar content of the fruit to be detected according to the sugar data corresponding to the fruit picture data.
A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, the processor implementing the above-mentioned method of measuring fruit sugar content when executing the computer program.
A computer readable storage medium storing a computer program which, when executed by a processor, implements the above-described fruit sugar content measurement method.
The invention provides a method, a device, computer equipment and a storage medium for measuring the sugar content of fruits, which are characterized in that firstly, fruit picture data of fruits to be measured are obtained; inputting the fruit picture data into a fruit sugar estimation model to obtain sugar data corresponding to the fruit picture data; the sugar estimation model is obtained by training according to the picture data of the fruit samples and the corresponding sugar content; and finally, determining the sugar content of the fruit to be detected according to the sugar data corresponding to the fruit picture data. Compared with the method for determining the sugar content of the fruit to be measured by extracting juice from the fruit to be measured and measuring the sugar content of the juice by a sugar meter at present, the method for determining the sugar content of the fruit to be measured based on the fruit picture data of the fruit to be measured, namely, the sugar content of the fruit to be measured is determined according to the fruit sugar estimation model.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings that are needed in the description of the embodiments of the present invention will be briefly described below, it being obvious that the drawings in the following description are only some embodiments of the present invention, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a schematic view of an application environment of a method for measuring sugar content of fruits according to an embodiment of the present invention;
FIG. 2 is a flow chart of a method for measuring sugar content of fruits according to an embodiment of the present invention;
FIG. 3 is a flow chart of determining sugar content of fruits to be tested according to sugar data in an embodiment of the invention;
FIG. 4 is a flowchart of obtaining fruit sample image data and sugar content according to an embodiment of the present invention;
FIG. 5 is a schematic view of sample image acquisition in accordance with an embodiment of the present invention;
FIG. 6 is a schematic diagram of a sample point sugar content measurement according to an embodiment of the present invention;
FIG. 7 is a flow chart of fruit sugar estimation model training in an embodiment of the invention;
FIG. 8 is a schematic diagram of fruit sugar estimation model training in an embodiment of the present invention;
FIG. 9 is a schematic block diagram of a fruit sugar content measuring device according to an embodiment of the present invention;
FIG. 10 is a schematic diagram of a computer device in accordance with an embodiment of the invention.
Detailed Description
The following description of the embodiments of the present invention will be made clearly and fully with reference to the accompanying drawings, in which it is evident that the embodiments described are some, but not all embodiments of the invention. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
The method for measuring the sugar content of the fruit can be applied to an application environment as shown in fig. 1, wherein the camera equipment is communicated with the computer equipment through a network. The method comprises the steps that computer equipment obtains fruit picture data of fruits to be detected, which are shot by camera equipment, and then the fruit picture data are input into a fruit sugar estimation model to obtain sugar data corresponding to the fruit picture data; the sugar estimation model is obtained by training according to the picture data of the fruit samples and the corresponding sugar content; and finally, determining the sugar content of the fruit to be detected according to the sugar data corresponding to the fruit picture data. The computer device may be, but is not limited to, various personal computers, notebook computers, smart phones, tablet computers, etc.
As shown in fig. 2, an embodiment of the present invention provides a method for measuring sugar content of fruits, which is illustrated by using a computer device in fig. 1 as an example, and includes the following steps:
s10, acquiring fruit picture data of fruits to be detected.
In the embodiment of the invention, the fruit picture data of the fruit to be detected can be obtained through the image pickup device, for example, the fruit picture data is obtained by using the RGB image shooting device.
And S20, inputting the fruit picture data into a fruit sugar estimation model to obtain sugar data corresponding to the fruit picture data.
The sugar estimation model is obtained by training according to the picture data of the fruit samples and the corresponding sugar content; specifically, the embodiment of the invention can train the fruit sample picture data and the corresponding sugar content through a convolutional neural network architecture to obtain a fruit sugar estimation model. It should be noted that, considering the possibility of deploying the method provided by the present invention to the mobile terminal, the architecture design of the convolutional neural network needs to pay attention to the light weight of the maintenance model, that is, the embodiment of the present invention adopts a light weight network structure design, and the parameter number is greatly reduced by some methods in the structure, so that the volume of the final fruit sugar estimation model can be small.
S30, determining the sugar content of the fruit to be detected according to the sugar data corresponding to the fruit picture data.
It should be noted that, when the sugar content of the fruit to be measured is measured, fruit picture data of multiple angles of the fruit to be measured can be obtained, then sugar data corresponding to each fruit picture data is determined according to the sugar estimation model, and then the sugar content of the fruit to be measured is determined based on the determined sugar data.
Specifically, as shown in fig. 3, the determining the sugar content of the fruit to be detected according to the sugar data corresponding to the fruit picture data includes:
s301, averaging sugar data corresponding to all fruit picture data of the fruits to be detected.
For example, fruit picture data of 3 fruits to be measured at different angles and different positions are obtained, then the 3 fruit picture data are respectively input into a fruit sugar estimation model to obtain sugar data corresponding to each fruit picture data, the sugar data corresponding to the fruit picture data are averaged, and the average value is determined to be the sugar content of the fruits to be measured.
S302, determining the average value as the sugar content of the fruit to be detected.
According to the method for determining the sugar content of the fruit to be detected, after sugar data corresponding to each piece of fruit picture data of the fruit to be detected are obtained, sugar data corresponding to all pieces of fruit picture data of the fruit to be detected are averaged, and then the average value is determined to be the sugar content of the fruit to be detected. Because the average value in the embodiment of the invention is determined according to the fruit picture data of a plurality of positions in the fruit to be measured, the accuracy of measuring the sugar content of the fruit to be measured can be improved through the embodiment of the invention.
The invention provides a method for measuring the sugar content of fruits, which comprises the steps of firstly, obtaining fruit picture data of fruits to be measured; inputting the fruit picture data into a fruit sugar estimation model to obtain sugar data corresponding to the fruit picture data; the sugar estimation model is obtained by training according to the picture data of the fruit samples and the corresponding sugar content; and finally, determining the sugar content of the fruit to be detected according to the sugar data corresponding to the fruit picture data. Compared with the method that juice is extracted from fruits to be measured at present, and then the sugar content of the fruits to be measured is determined by measuring the sugar content of the juice by a sugar meter, the method provided by the invention is used for determining the sugar content of the fruits based on the fruit picture data of the fruits to be measured, namely determining the sugar content of the fruits to be measured according to the fruit sugar estimation model.
In one embodiment of the present invention, the fruit sugar estimation model is trained by the following method: acquiring picture data of fruit samples and corresponding sugar content; and training the convolutional neural network according to the fruit sample picture data and the corresponding sugar content to obtain the fruit sugar estimation model. Wherein 80% of fruit sample picture data and corresponding sugar content are used as training data sets, and 20% of fruit sample picture data and corresponding sugar content are used as test data sets.
As shown in fig. 4, in one embodiment of the present invention, the obtaining the fruit sample picture data and the corresponding sugar content includes:
s101, determining sample points on the surface of a sample fruit and sugar content corresponding to the sample points; and acquiring images of each sample point from a plurality of angles to obtain a sample image.
In the embodiment of the invention, a plurality of sample points can be randomly selected on the surface of the sample fruit, so that the selected sample points relate to different areas of the sample fruit as much as possible. Then, with the sample points as the center of the image field of view, as shown in fig. 5, image acquisition is performed from a plurality of angles for each sample point using an RGB image capturing apparatus. In the embodiment of the present invention, the size of the acquired sample image may be 640×480.
After determining the sample points on the surface of the sample fruit, as shown in fig. 6, at each sample point on the surface of the sample fruit, apple pulp with a diameter of 5mm and a depth of 5mm is cut out and juice is taken, and then the actual sugar content of the sample points is measured as labels of the sample points by using a sugar meter, i.e. the sugar content value of one sample point corresponds to a plurality of sample images of the sample point. And (3) constructing a sample image and sugar content data set by collecting a large number of sample points of a large number of sample images, and taking 80% of sample points on the surface of the sample fruit and sugar content corresponding to the sample points as a training data set and 20% of sample points on the surface of the sample fruit and sugar content corresponding to the sample points as a test data set.
S102, taking the sample point as a center, and cutting out a plurality of fruit sample picture data with different sizes from the sample image.
It should be noted that, since the sample point to be estimated is located at the center of the sample image, the feature information of the surrounding area of the sample point is given more weight in the prediction process, and meanwhile, the apple epidermis and the environmental feature information in a larger field of view are combined. Therefore, the embodiment of the invention adopts multi-scale input to fuse information, namely, a plurality of fruit sample picture data with different sizes are intercepted from the sample image, and then the intercepted fruit sample picture data with different sizes are fused, so that the fused picture data can more represent the characteristics of sample fruits.
Specifically, in one embodiment provided by the invention, fruit sample picture data of a first preset size, a second preset size and a third preset size are cut from the sample image by taking the sample point as a center, wherein the fruit sample picture data of the first preset size comprises fruit surrounding environment characteristics, the fruit sample image data of the second preset size comprises whole fruit surrounding characteristics, and the fruit sample image data of the third preset size comprises fruit sample point surrounding characteristics.
For example, fruit sample picture data of a first preset size, a second preset size and a third preset size are taken from the sample image by taking a sample point as a center, wherein the fruit sample picture data of the first preset size is 480 x 480 pixels, the fruit sample picture data of the second preset size is 240 x 240 pixels, and the fruit sample picture data of the third preset size is 120 x 120 pixels. It should be noted that, in the embodiment of the present invention, the first preset size, the second preset size, and the third preset size may be set according to actual needs, which is not limited in particular.
Correspondingly, after capturing a plurality of fruit sample image data with different sizes from the sample image by taking a sample point as a center, training the convolutional neural network according to the fruit sample image data and the corresponding sugar content to obtain the fruit sugar estimation model, wherein the training comprises the following steps: training the convolutional neural network according to the intercepted picture data of a plurality of fruit samples with different sizes and the corresponding sugar content to obtain the fruit sugar estimation model. Specifically, the embodiment of the invention can perform feature fusion on a plurality of fruit sample image data with different sizes, and then train the convolutional neural network according to the fused fruit sample image data and the corresponding sugar content to obtain a fruit sugar estimation model.
In an embodiment of the present invention, as shown in fig. 7 and fig. 8, training the convolutional neural network according to the intercepted image data of a plurality of fruit samples with different sizes and corresponding sugar contents to obtain the fruit sugar estimation model includes:
s201, the fruit sample picture data with the first preset size passes through a convolution layer to obtain conversion data with the second preset size.
For example, the fruit sample picture data 480×480 of the first preset size is subjected to a convolution layer to obtain the conversion data 240×240 of the second preset size. When the convolution kernel size is set to 3x3 and the step size is set to 2, the length and width of the input fruit sample picture data are reduced by half.
S202, splicing the conversion data of the second preset size and the fruit sample image data of the second preset size in the channel direction to obtain a first feature fusion map.
Namely, the second preset size conversion data 240 x 240 and the second preset size fruit sample picture data 240 x 240 are spliced in the channel direction to obtain a first feature fusion graph.
S203, obtaining conversion data of a third preset size through a convolution layer for the first feature fusion graph.
Specifically, the first feature fusion map 240×240 is subjected to a convolution layer to obtain conversion data 120×120 of a third preset size.
S204, splicing the conversion data of the third preset size and the fruit sample image data of the third preset size in the channel direction to obtain a second feature fusion graph.
And splicing the conversion data 120 x 120 of the third preset size and the fruit sample picture data of the third preset size to 120 x 120 in the channel direction to obtain a second feature fusion graph.
And S205, training a convolutional neural network according to the second characteristic fusion graph and the corresponding sugar content to obtain the fruit sugar estimation model.
In the embodiment of the invention, after the second feature fusion map is obtained, the second feature fusion map is input into a modified ShuffleNetV2 module, and the last layer is replaced by a single-value output full-connection layer, so that the predicted value of the sugar content of the fruit to be detected is finally obtained. Training the neural network by using a training data set and utilizing a counter-propagation and gradient descent strategy to finally obtain an apple sugar content estimation model.
It should be understood that the sequence number of each step in the foregoing embodiment does not mean that the execution sequence of each process should be determined by the function and the internal logic, and should not limit the implementation process of the embodiment of the present invention.
In an embodiment, a device for measuring the sugar content of fruits is provided, and the device for measuring the sugar content of fruits corresponds to the method for measuring the sugar content of fruits in the embodiment one by one. As shown in fig. 9, the fruit sugar content measuring apparatus includes: an acquisition module 10, a calculation module 20, a determination module 30.
The functional modules are described in detail as follows:
the acquisition module 10 is used for acquiring fruit picture data of fruits to be detected;
the computing module 20 is configured to input the fruit picture data into a fruit sugar estimation model to obtain sugar data corresponding to the fruit picture data; the sugar estimation model is obtained by training according to the picture data of the fruit samples and the corresponding sugar content;
and the determining module 30 is used for determining the sugar content of the fruit to be detected according to the sugar data corresponding to the fruit picture data.
Further, the device further comprises:
the obtaining module 10 is further configured to obtain fruit sample picture data and corresponding sugar content;
and the training module 40 is used for training the convolutional neural network according to the fruit sample picture data and the corresponding sugar content to obtain the fruit sugar estimation model.
Further, the acquiring module 10 includes:
a determining unit 11 for determining a sample point of the surface of the sample fruit and a sugar content corresponding to the sample point; image acquisition is carried out on each sample point from a plurality of angles to obtain a sample image;
a cutting unit 12, configured to cut a plurality of fruit sample picture data with different sizes from the sample image with the sample point as a center;
the training module 40 is specifically configured to train the convolutional neural network according to the intercepted image data of a plurality of fruit samples with different sizes and corresponding sugar contents, so as to obtain the fruit sugar estimation model.
The capturing unit 12 is specifically configured to capture, from the sample image, fruit sample picture data of a first preset size, a second preset size, and a third preset size with the sample point as a center, where the fruit sample picture data of the first preset size includes a feature of surrounding environment of a fruit, the fruit sample image data of the second preset size includes a feature of surrounding the whole fruit, and the fruit sample image data of the third preset size includes a feature of surrounding the fruit sample point.
Further, the training module 40 includes:
a convolution unit 41, configured to obtain conversion data of a second preset size by using the fruit sample picture data of the first preset size through a convolution layer;
a stitching unit 42, configured to stitch the conversion data of the second preset size and the fruit sample image data of the second preset size in the channel direction to obtain a first feature fusion map;
the convolution unit 41 is further configured to obtain conversion data of a third preset size from the first feature fusion map through the convolution layer;
the stitching unit 42 is further configured to stitch the conversion data of the third preset size and the fruit sample image data of the third preset size in a channel direction to obtain a second feature fusion map;
and the training unit 43 is used for training the convolutional neural network according to the second feature fusion graph and the corresponding sugar content to obtain the fruit sugar estimation model.
Further, the determining module 30 includes:
an average calculating unit 31, configured to average sugar data corresponding to all fruit picture data of the fruit to be detected;
a determining unit 32, configured to determine the average value as the sugar content of the fruit to be tested.
For specific limitations on the means for measuring the sugar content of the fruit, reference may be made to the above limitations on the method for measuring the sugar content of the fruit, and no further description is given here. The above-mentioned various modules in the fruit sugar content measuring device can be implemented in whole or in part by software, hardware and combinations thereof. The above modules may be embedded in hardware or may be independent of a processor in the computer device, or may be stored in software in a memory in the computer device, so that the processor may call and execute operations corresponding to the above modules.
In one embodiment, a computer device is provided, which may be a server, and the internal structure of which may be as shown in fig. 10. The computer device includes a processor, a memory, a network interface, and a database connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, computer programs, and a database. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The network interface of the computer device is used for communicating with an external terminal through a network connection. The computer program is executed by the processor to implement a method for measuring the sugar content of fruits.
In one embodiment, a computer device is provided comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, the processor implementing the steps of when executing the computer program:
acquiring fruit picture data of fruits to be detected;
inputting the fruit picture data into a fruit sugar estimation model to obtain sugar data corresponding to the fruit picture data; the sugar estimation model is obtained by training according to the picture data of the fruit samples and the corresponding sugar content;
and determining the sugar content of the fruit to be detected according to the sugar data corresponding to the fruit picture data.
In one embodiment, a computer readable storage medium is provided having a computer program stored thereon, which when executed by a processor, performs the steps of:
acquiring fruit picture data of fruits to be detected;
inputting the fruit picture data into a fruit sugar estimation model to obtain sugar data corresponding to the fruit picture data; the sugar estimation model is obtained by training according to the picture data of the fruit samples and the corresponding sugar content;
and determining the sugar content of the fruit to be detected according to the sugar data corresponding to the fruit picture data.
Those skilled in the art will appreciate that implementing all or part of the above described methods may be accomplished by way of a computer program stored on a non-transitory computer readable storage medium, which when executed, may comprise the steps of the embodiments of the methods described above. Any reference to memory, storage, database, or other medium used in the various embodiments provided herein may include non-volatile and/or volatile memory. The nonvolatile memory can include Read Only Memory (ROM), programmable ROM (PROM), electrically Programmable ROM (EPROM), electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double Data Rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous Link DRAM (SLDRAM), memory bus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), among others.
It will be apparent to those skilled in the art that, for convenience and brevity of description, only the above-described division of the functional units and modules is illustrated, and in practical application, the above-described functional distribution may be performed by different functional units and modules according to needs, i.e. the internal structure of the apparatus is divided into different functional units or modules to perform all or part of the above-described functions.
The above embodiments are only for illustrating the technical solution of the present invention, and are not limiting; although the invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical scheme described in the foregoing embodiments can be modified or some technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit and scope of the technical solutions of the embodiments of the present invention, and are intended to be included in the scope of the present invention.

Claims (5)

1. A method for measuring sugar content of fruits, the method comprising:
determining sample points on the surface of the sample fruits and sugar content corresponding to the sample points; image acquisition is carried out on each sample point from a plurality of angles to obtain a sample image;
intercepting fruit sample picture data of a first preset size, a second preset size and a third preset size from the sample image by taking the sample point as a center, wherein the fruit sample picture data of the first preset size comprises fruit surrounding environment characteristics, the fruit sample image data of the second preset size comprises whole fruit surrounding characteristics, and the fruit sample image data of the third preset size comprises fruit sample point surrounding characteristics;
training the convolutional neural network according to the intercepted picture data of a plurality of fruit samples with different sizes and the corresponding sugar content to obtain a fruit sugar estimation model;
acquiring fruit picture data of fruits to be detected;
inputting the fruit picture data into a fruit sugar estimation model to obtain sugar data corresponding to the fruit picture data; the sugar estimation model is obtained by training according to the picture data of the fruit samples and the corresponding sugar content;
determining sugar content of the fruit to be detected according to sugar data corresponding to the fruit picture data;
training the convolutional neural network according to the intercepted fruit sample picture data with a plurality of different sizes and corresponding sugar content to obtain the fruit sugar estimation model, wherein the training comprises the following steps:
the fruit sample picture data with the first preset size passes through a convolution layer to obtain conversion data with the second preset size;
splicing the conversion data of the second preset size and the fruit sample image data of the second preset size in the channel direction to obtain a first characteristic fusion map;
obtaining conversion data of a third preset size from the first feature fusion map through the convolution layer;
splicing the conversion data of the third preset size and the fruit sample image data of the third preset size in the channel direction to obtain a second characteristic fusion map;
and training the convolutional neural network according to the second characteristic fusion graph and the corresponding sugar content to obtain the fruit sugar estimation model.
2. The method for measuring sugar content of fruits according to claim 1, wherein determining sugar content of the fruits to be measured according to sugar data corresponding to the fruit picture data comprises:
averaging sugar data corresponding to all fruit picture data of the fruits to be detected;
and determining the average value as the sugar content of the fruit to be detected.
3. A device for measuring sugar content of fruits, said device comprising:
the acquisition module is used for determining sample points on the surface of the sample fruit and sugar content corresponding to the sample points; image acquisition is carried out on each sample point from a plurality of angles to obtain a sample image; intercepting fruit sample picture data of a first preset size, a second preset size and a third preset size from the sample image by taking the sample point as a center, wherein the fruit sample picture data of the first preset size comprises fruit surrounding environment characteristics, the fruit sample image data of the second preset size comprises whole fruit surrounding characteristics, and the fruit sample image data of the third preset size comprises fruit sample point surrounding characteristics;
the training module is used for training the convolutional neural network according to the intercepted fruit sample picture data with a plurality of different sizes and the corresponding sugar content to obtain a fruit sugar estimation model;
the acquisition module is used for acquiring fruit picture data of fruits to be detected;
the computing module is used for inputting the fruit picture data into a fruit sugar estimation model to obtain sugar data corresponding to the fruit picture data; the sugar estimation model is obtained by training according to the picture data of the fruit samples and the corresponding sugar content;
the determining module is used for determining the sugar content of the fruit to be detected according to the sugar data corresponding to the fruit picture data;
the training module is specifically used for:
the fruit sample picture data with the first preset size passes through a convolution layer to obtain conversion data with the second preset size;
splicing the conversion data of the second preset size and the fruit sample image data of the second preset size in the channel direction to obtain a first characteristic fusion map;
obtaining conversion data of a third preset size from the first feature fusion map through the convolution layer;
splicing the conversion data of the third preset size and the fruit sample image data of the third preset size in the channel direction to obtain a second characteristic fusion map;
and training the convolutional neural network according to the second characteristic fusion graph and the corresponding sugar content to obtain the fruit sugar estimation model.
4. Computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that the processor implements the method for measuring fruit sugar content according to any one of claims 1 to 2 when executing the computer program.
5. A computer-readable storage medium storing a computer program, characterized in that the computer program, when executed by a processor, implements the method for measuring fruit sugar content according to any one of claims 1 to 2.
CN202010350875.XA 2020-04-28 2020-04-28 Method and device for measuring sugar content of fruit, computer equipment and storage medium Active CN111551499B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010350875.XA CN111551499B (en) 2020-04-28 2020-04-28 Method and device for measuring sugar content of fruit, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010350875.XA CN111551499B (en) 2020-04-28 2020-04-28 Method and device for measuring sugar content of fruit, computer equipment and storage medium

Publications (2)

Publication Number Publication Date
CN111551499A CN111551499A (en) 2020-08-18
CN111551499B true CN111551499B (en) 2023-07-04

Family

ID=71998269

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010350875.XA Active CN111551499B (en) 2020-04-28 2020-04-28 Method and device for measuring sugar content of fruit, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN111551499B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112465077B (en) * 2021-02-02 2021-04-16 中国人民解放军国防科技大学 Fruit sugar degree nondestructive detection method and device, computer equipment and storage medium

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104568639B (en) * 2013-10-11 2017-08-25 中国林业科学研究院资源信息研究所 A kind of determination method and apparatus of sugar degree
CN110781889B (en) * 2019-10-26 2022-02-08 苏州大学 Deep learning-based nondestructive testing method for total sugar content in blueberry fruits
CN110826552A (en) * 2019-11-05 2020-02-21 华中农业大学 Grape nondestructive automatic detection device and method based on deep learning

Also Published As

Publication number Publication date
CN111551499A (en) 2020-08-18

Similar Documents

Publication Publication Date Title
CN110275958B (en) Website information identification method and device and electronic equipment
CN110781859B (en) Image annotation method and device, computer equipment and storage medium
CN111666995B (en) Vehicle damage assessment method, device, equipment and medium based on deep learning model
JP2021532459A (en) Target cell labeling methods, devices, storage media and terminal devices
CN111144285B (en) Fat and thin degree identification method, device, equipment and medium
CN113496208B (en) Video scene classification method and device, storage medium and terminal
CN109978044B (en) Training data generation method and device, and model training method and device
CN110163850B (en) Adhesive quality detection method and device, computer equipment and storage medium
CN113269775B (en) Defect detection method and device based on multi-scale feature fusion SSD
CN111551499B (en) Method and device for measuring sugar content of fruit, computer equipment and storage medium
CN113284113B (en) Glue overflow flaw detection method, device, computer equipment and readable storage medium
CN115375617A (en) Defect detection and training method and device, storage medium and equipment
US20220156534A1 (en) Target object detection model
CN111444833B (en) Fruit actual measurement production method, device, computer equipment and storage medium
CN111931721B (en) Method and device for detecting color and number of annual inspection label and electronic equipment
CN115082758B (en) Training method of target detection model, target detection method, device and medium
CN115272682A (en) Target object detection method, target detection model training method and electronic equipment
CN111292374B (en) Method and equipment for automatically plugging and unplugging USB interface
CN113283978A (en) Financial risk assessment method based on biological basis, behavior characteristics and business characteristics
CN112819030A (en) Image recognition model training method and device, storage medium and terminal
CN113343554A (en) Arch dam underwater damage identification method, terminal equipment and storage medium
CN111950527A (en) Target detection method and device based on YOLO V2 neural network
CN107451047B (en) Browser function testing method and system and electronic equipment
CN113709563B (en) Video cover selecting method and device, storage medium and electronic equipment
CN112801082B (en) Image sampling method and device and electronic equipment

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