CN108447054B - Wood defect sample obtaining method and device, electronic equipment and storage medium - Google Patents

Wood defect sample obtaining method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN108447054B
CN108447054B CN201810240671.3A CN201810240671A CN108447054B CN 108447054 B CN108447054 B CN 108447054B CN 201810240671 A CN201810240671 A CN 201810240671A CN 108447054 B CN108447054 B CN 108447054B
Authority
CN
China
Prior art keywords
wood
sample data
defect
qualified
wood sample
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
CN201810240671.3A
Other languages
Chinese (zh)
Other versions
CN108447054A (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.)
Beijing Muyebang Technology Co ltd
Original Assignee
Beijing Muyebang Technology Co ltd
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 Beijing Muyebang Technology Co ltd filed Critical Beijing Muyebang Technology Co ltd
Priority to CN201810240671.3A priority Critical patent/CN108447054B/en
Publication of CN108447054A publication Critical patent/CN108447054A/en
Application granted granted Critical
Publication of CN108447054B publication Critical patent/CN108447054B/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
    • 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
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/40Analysis of texture
    • 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/30161Wood; Lumber

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)
  • Biomedical Technology (AREA)
  • Computational Linguistics (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Quality & Reliability (AREA)
  • Health & Medical Sciences (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Biophysics (AREA)
  • Evolutionary Biology (AREA)
  • General Health & Medical Sciences (AREA)
  • Molecular Biology (AREA)
  • Computing Systems (AREA)
  • Mathematical Physics (AREA)
  • Software Systems (AREA)
  • Image Analysis (AREA)
  • Investigating Materials By The Use Of Optical Means Adapted For Particular Applications (AREA)

Abstract

The embodiment of the disclosure discloses a method and a device for acquiring a wood defect sample, electronic equipment and a storage medium. The method comprises the following steps: acquiring qualified wood sample data; acquiring an existing defect characteristic image according to qualified wood sample data; the existing defect characteristic image is obtained from an existing defect wood sample database; and synthesizing the existing defect characteristic image and the qualified wood sample data to obtain defect wood sample data which is the same as the wood category of the qualified wood sample data. By the method, the problems that the wood defects cannot be identified and the identification precision is low due to the defect of the defective wood sample in the initial training stage of the artificial intelligence model are solved, the acquisition mode of the defective wood sample data is simplified, and the cost is saved.

Description

Wood defect sample obtaining method and device, electronic equipment and storage medium
Technical Field
The disclosure relates to the technical field of artificial intelligence, in particular to a method and a device for acquiring a wood defect sample, electronic equipment and a computer-readable storage medium.
Background
Wood factories require quality testing of wood, including sample quality ratings and defect sample identification. From initial manual visual inspection, to machine learning inspection today, each new stage has an improvement in performance or efficiency over the previous old stage. Machine learning detection requires training of the neural network first, and the trained model is used for detection. Neural network training requires training samples with labeled classification data. The sample data is generally obtained by collecting wood images in a wood factory and performing classification and labeling by a labeling person.
However, in general, in a wood processing plant, a lot of qualified wood samples can be obtained, few defective samples are obtained, the unbalanced distribution of the samples makes the defective samples not easy to obtain, and thus the trained neural network can only identify the qualified wood, but has low capacity or accuracy for identifying the defective wood. Furthermore, different species of wood have different qualifying sample characteristics and cannot be directly transplanted into a new wood species or product with an identification model of another species. Therefore, there is a need for a method for synthesizing wood defect samples, which can synthesize sufficient defect samples of wood species required by factories using existing resources, and further accelerate neural network training for identifying a new wood product or variety.
Disclosure of Invention
The embodiment of the disclosure provides a wood defect sample obtaining method and device, electronic equipment and a computer readable storage medium.
In a first aspect, an embodiment of the present disclosure provides a method for obtaining a wood defect sample, including:
acquiring qualified wood sample data;
acquiring an existing defect characteristic image according to qualified wood sample data; the existing defect characteristic image is obtained from an existing defect wood sample database;
and synthesizing the existing defect characteristic image and the qualified wood sample data to obtain defect wood sample data which is the same as the wood category of the qualified wood sample data.
Optionally, acquiring an existing defect feature image according to qualified wood sample data, including:
when the number of first existing defective wood sample data of which the wood category is the same as that of the qualified wood sample data in the existing defective wood sample database is less than or equal to a first preset threshold value, obtaining second existing defective wood sample data which is different from that of the qualified wood sample data from the existing defective wood sample database;
and extracting the existing defect characteristic image from the second existing defect wood sample data.
Optionally, the method further comprises:
and in the existing defective wood sample database, when the number of first existing defective wood sample data of which the wood category is the same as that of the qualified wood sample data is greater than a first preset threshold value, taking the first existing defective wood sample data as the defective wood sample data.
Optionally, the qualified wood sample data comprises a qualified wood sample image and labeling data; synthesizing the existing defect characteristic image and the qualified wood sample data to obtain defect wood sample data which is the same as the wood category of the qualified wood sample data, wherein the method comprises the following steps:
and covering part or all of the existing defect characteristic image on a preset area of the qualified wood sample image to obtain defect wood sample data with the same wood category as that of the qualified wood sample data.
Optionally, the method further comprises:
and adjusting the texture features of the boundary region of the synthesized existing defect feature image, so that the difference between the texture features of the boundary region and the texture features of the existing defect feature image and/or the texture features of the qualified wood sample is smaller than a second preset threshold value.
Optionally, adjusting the texture feature of the boundary region of the synthesized existing defect feature image includes:
and filtering the texture features of the boundary region by using a low-pass filter.
Optionally, adjusting the texture feature of the boundary region of the existing defect feature image on the qualified wood sample image includes:
and carrying out image processing on the boundary area by using a trained artificial intelligence model, so that the image style of the boundary area comes from the existing defect characteristic image, and the image content of the boundary area comes from the qualified wood sample image.
Optionally, synthesizing the existing defect feature image and the qualified wood sample data to obtain defect wood sample data of the same wood category as the qualified wood sample data, further comprising:
generating marking data of the sample data of the defective wood; the marking data comprises defect marks and wood categories in the qualified wood sample data.
Optionally, the method further comprises:
training based on the qualified wood sample data and the defect sample data to obtain a wood defect identification model; alternatively, the first and second electrodes may be,
training based on the qualified wood sample data and the defect sample data to obtain an identification model of the wood defects, and outputting the identification model of the wood defects to a client.
Optionally, the method further comprises:
and outputting the sample data of the defective wood to a client.
In a second aspect, an embodiment of the present disclosure provides a wood defect sample acquiring device, including:
a first obtaining module configured to obtain qualified wood sample data;
the second acquisition module is configured to acquire an existing defect characteristic image according to qualified wood sample data; the existing defect characteristic image is obtained from an existing defect wood sample database;
and the synthesis module is configured to synthesize the existing defect characteristic image and the qualified wood sample data to obtain defect wood sample data which is the same as the wood category of the qualified wood sample data.
Optionally, the second obtaining module includes:
a first obtaining sub-module, configured to obtain, in the existing defective wood sample database, a second existing defective wood sample data that is different from the wood category of the qualified wood sample data from the existing defective wood sample database when the number of first existing defective wood sample data that is the same as the wood category of the qualified wood sample data is less than or equal to a first preset threshold;
an extraction submodule configured to extract the existing defect feature image from the second existing defect wood sample data.
Optionally, the apparatus further comprises:
a third obtaining module, configured to, when the number of first existing defective wood sample data in the existing defective wood sample database, which is the same as the wood category of the qualified wood sample data, is greater than a first preset threshold, take the first existing defective wood sample data as the defective wood sample data.
Optionally, the qualified wood sample data comprises a qualified wood sample image and labeling data; the synthesis module comprises:
and the synthesis submodule is configured to cover part or all of the existing defect characteristic image on a preset area of the qualified wood sample image to obtain defect wood sample data which is the same as the wood category of the qualified wood sample data.
Optionally, the apparatus further comprises:
and the adjusting module is configured to adjust the texture features of the boundary area of the synthesized existing defect feature image, so that the difference between the texture features of the boundary area and the texture features of the existing defect feature image and/or the texture features of the qualified wood sample is smaller than a second preset threshold value.
Optionally, the adjusting module includes:
a filtering submodule configured to filter the textural features of the junction region with a low pass filter.
Optionally, the adjusting module includes:
and the image processing submodule is configured to perform image processing on the boundary area by using a trained artificial intelligence model, so that the image style of the boundary area comes from the existing defect characteristic image, and the image content of the boundary area comes from the qualified wood sample image.
Optionally, the synthesis module further includes:
the labeling submodule is configured to generate labeling data of the defective wood sample data; the marking data comprises defect marks and wood categories in the qualified wood sample data.
Optionally, the apparatus further comprises:
a first training module configured to train to obtain a wood defect identification model based on the qualified wood sample data and the defect sample data; alternatively, the first and second electrodes may be,
and the second training module is configured to train to obtain a wood defect identification model based on the qualified wood sample data and the defect sample data, and output the wood defect identification model to the client.
Optionally, the apparatus further comprises:
an output module configured to output the defective wood sample data to a client.
The functions can be realized by hardware, and the functions can also be realized by executing corresponding software by hardware. The hardware or software includes one or more modules corresponding to the above-described functions.
In one possible design, the structure of the wood defect sample acquiring device includes a memory and a processor, the memory is used for storing one or more computer instructions supporting the wood defect sample acquiring device to execute the wood defect sample acquiring method in the first aspect, and the processor is configured to execute the computer instructions stored in the memory. The wood defect sample acquiring device may further include a communication interface for the wood defect sample acquiring device to communicate with other equipment or a communication network.
In a third aspect, an embodiment of the present disclosure provides an electronic device, including a memory and a processor; wherein the memory is configured to store one or more computer instructions, wherein the one or more computer instructions are executed by the processor to implement the method steps of the first aspect.
In a fourth aspect, the disclosed embodiments provide a computer-readable storage medium for storing computer instructions for a wood defect sample acquiring apparatus, which contains computer instructions for executing the wood defect sample acquiring method in the first aspect.
The technical scheme provided by the embodiment of the disclosure can have the following beneficial effects:
after the qualified wood sample data is obtained, the existing defect characteristic image is extracted from the existing defect sample data, and the existing defect characteristic image is synthesized to the qualified wood sample image, so that the defective wood sample data with the same wood type as the qualified wood sample data is obtained. By the method, the problems that the wood defects cannot be identified and the identification precision is low due to the defect of the defective wood sample in the initial training stage of the artificial intelligence model are solved, the acquisition mode of the defective wood sample data is simplified, and the cost is saved.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
Other features, objects, and advantages of the present disclosure will become more apparent from the following detailed description of non-limiting embodiments when taken in conjunction with the accompanying drawings. In the drawings:
fig. 1 shows a flow chart of a method of wood defect sample acquisition according to an embodiment of the present disclosure;
FIG. 2 shows a flow chart of step S102 according to the embodiment shown in FIG. 1;
FIG. 3 shows a schematic diagram of an extracted pre-existing defect feature image overlaid entirely on a qualified wood sample image according to an embodiment of the present disclosure;
FIG. 4 illustrates a schematic view of an existing defect feature image partially overlaid on a qualified wood sample image according to an embodiment of the present disclosure;
FIG. 5 illustrates yet another schematic view of an existing defect feature image partially overlaid on a qualified wood sample image according to an embodiment of the present disclosure;
fig. 6 shows a schematic diagram of a VGG network according to an embodiment of the present disclosure;
fig. 7 illustrates a block diagram of a structure of a wood defect sample acquiring device according to an embodiment of the present disclosure;
fig. 8 is a schematic structural diagram of an electronic device suitable for implementing a wood defect sample acquisition method according to an embodiment of the present disclosure.
Detailed Description
Hereinafter, exemplary embodiments of the present disclosure will be described in detail with reference to the accompanying drawings so that those skilled in the art can easily implement them. Also, for the sake of clarity, parts not relevant to the description of the exemplary embodiments are omitted in the drawings.
In the present disclosure, it is to be understood that terms such as "including" or "having," etc., are intended to indicate the presence of the disclosed features, numbers, steps, behaviors, components, parts, or combinations thereof, and are not intended to preclude the possibility that one or more other features, numbers, steps, behaviors, components, parts, or combinations thereof may be present or added.
It should be further noted that the embodiments and features of the embodiments in the present disclosure may be combined with each other without conflict. The present disclosure will be described in detail below with reference to the accompanying drawings in conjunction with embodiments.
In a wood processing plant, a lot of qualified wood samples can be obtained, but few defect samples are obtained, the defect samples are not easy to obtain due to unbalanced distribution of the samples, and thus, the trained artificial intelligence model can only identify the qualified wood, but the identification capability or the accuracy of the defective wood is not high enough. Moreover, through experiments, the qualified sample characteristics of different types of wood are different, and an identification model of other types cannot be directly transplanted into a new wood type or product, but the defect sample characteristics of some different types of wood are similar. Therefore, the embodiment of the present disclosure provides a method for obtaining a wood defect sample, which can synthesize a qualified sample of a factory and a defect sample of a cloud to obtain a defect sample of a wood type required by the factory, and is used to accelerate training of an artificial intelligence model for identifying a new wood product or variety.
Fig. 1 shows a flowchart of a wood defect sample acquisition method according to an embodiment of the present disclosure. As shown in fig. 1, the wood defect sample acquiring method includes the following steps S101 to S103:
in step S101, sample data of qualified wood is acquired;
in step S102, acquiring an existing defect characteristic image according to qualified wood sample data; the existing defect characteristic image is obtained from an existing defect wood sample database;
in step S103, synthesizing the existing defect feature image and the qualified wood sample data to obtain defect wood sample data of the same wood category as the qualified wood sample data.
In this embodiment, the qualified wood sample data may be data of a wood sample considered as having no defects, which is provided by a factory, and includes an image of the wood sample, a wood species, and the like. The existing defective wood sample database can store some known defective wood sample data with defects, including images of the defective wood sample data, defect information, wood categories and the like; the defect information may include a location of the defect, a kind of the defect, and the like. The defect feature image may be an image of a defect site extracted from the non-qualified wood sample data. In one embodiment, the existing defect feature image can be obtained according to the qualified wood sample data in a predefined manner, and the existing defect feature image is synthesized to the qualified wood sample image to obtain the defective wood sample data with the same wood type as the qualified wood sample, so as to expand the unqualified wood sample data corresponding to the qualified wood sample and provide a basis for further training the artificial intelligence model.
In an optional implementation manner of this embodiment, as shown in fig. 2, the step S102, namely the step of obtaining the existing defect feature image according to the qualified wood sample data, further includes the following steps S201 to S202:
in step S201, when the number of first existing defective wood sample data in the existing defective wood sample database, which is the same as the wood category of the qualified wood sample data, is less than or equal to a first preset threshold, obtaining second existing defective wood sample data, which is different from the wood category of the qualified wood sample data, from the existing defective wood sample database;
in step S202, the existing defect feature image is extracted from the second existing defect wood sample data.
In this optional implementation manner, the acquired qualified wood sample data may include the wood type of the qualified wood sample, and when the existing defect feature image is acquired, it may be checked first whether the number of the defect wood samples in the existing defect wood sample database, which are the same as the wood type, is not enough, that is, whether the number of the defect wood samples is less than or equal to a first preset threshold value, if so, a defect wood sample different from the wood type is acquired from the existing defect wood sample database, and the defect feature image is extracted from the different defect wood samples, so that the extracted defect feature image is synthesized onto the image of the qualified wood sample. The wood defect types can be various, for example, the wood defect types can be classified into joints, dead knots, decay, cracks, insect pests and the like, so that a second existing defect wood sample data with various wood defect types can be obtained from the existing defect wood sample database, and existing defect feature images of various types can be obtained, so that various defect wood sample data with the same wood type as that of the qualified wood sample but different defect types can be obtained.
In an optional implementation manner of this embodiment, the method for acquiring a wood defect sample further includes:
and in the existing defective wood sample database, when the number of first existing defective wood sample data of which the wood category is the same as that of the qualified wood sample data is greater than a first preset threshold value, taking the first existing defective wood sample data as the defective wood sample data.
In this optional implementation manner, when there are more first existing defective wood sample data of the same kind as the qualified wood sample in the existing defective wood sample database, that is, greater than the first preset threshold, existing defective wood sample data of the same kind as the qualified wood sample may be directly obtained from the existing defective wood sample database, without synthesizing the defective feature images of other kinds of wood.
In an optional implementation manner of this embodiment, the qualified wood sample data includes a qualified wood sample image and label data; synthesizing the existing defect characteristic image and the qualified wood sample data to obtain defect wood sample data which is the same as the wood category of the qualified wood sample data, wherein the method comprises the following steps:
and covering part or all of the existing defect characteristic image on a preset area of the qualified wood sample image to obtain defect wood sample data with the same wood category as that of the qualified wood sample data.
In this alternative implementation, when synthesizing the image, the image synthesis may be performed by covering part or all of the existing defect feature image in the preset area of the qualified wood sample image. The preset area may be at any position of the qualified wood sample image, such as a middle position, an edge position, and the like. FIG. 3 shows a schematic diagram of an extracted existing defect feature image overlaid on a qualified wood sample image; fig. 4 and 5 are schematic diagrams respectively showing the existing defect feature image partially overlaid on the qualified wood sample image.
In an optional implementation manner of this embodiment, the method for acquiring a wood defect sample further includes: and adjusting the texture features of the boundary region of the synthesized existing defect feature image, so that the difference between the texture features of the boundary region and the texture features of the existing defect feature image and/or the texture features of the qualified wood sample is smaller than a second preset threshold value.
In the optional implementation mode, after the existing defect feature image is synthesized on the qualified wood sample image, the texture feature at the junction of the existing defect feature image and the qualified wood sample image can be adjusted to enable the texture feature at the junction of the existing defect feature image and the qualified wood sample image to be consistent, namely the difference of the texture feature is smaller than a preset threshold value, so that the texture trend on the qualified wood sample image can be naturally transited to the texture trend of the existing defect feature image, and the textures of the existing defect feature image and the qualified wood sample image are organically connected. In the adjusting process, the existing defect characteristic image can be not sacrificed as much as possible, but some small adjustment can be made on the partial image at the boundary of the existing defect characteristic image. The interface region may be a region where the existing defect feature image and the qualified wood sample image interface after the existing defect feature image is partially or completely overlaid on the qualified wood sample image, including but not limited to a portion of the qualified wood sample image, a portion of the existing defect feature image, or a combination thereof. In the operation process, the existing defect feature image can be kept unchanged, the texture features of the part of qualified wood sample images outside the boundary of the existing defect feature image can be adjusted, the qualified wood sample images can also be kept unchanged, the texture features of the part of images inside the boundary of the existing defect feature image can be adjusted, the texture features of the part of images inside the boundary of the existing defect feature image and the texture features of the part of qualified wood sample images outside the boundary of the existing defect feature image can also be adjusted together, the operation can be specifically carried out according to the actual situation, and the operation is not limited herein.
In an optional implementation manner of this embodiment, the step of adjusting the texture feature of the boundary region of the synthesized existing defect feature image further includes the following steps:
and filtering the texture features of the boundary region by using a low-pass filter.
In this alternative implementation, the texture feature may be adjusted by a low-pass filter. For example, the texture features of the qualified wood sample image in the boundary area are greatly different from those of the existing defect feature image, and the difference can generate high-frequency components, so that after passing through a low-pass filter, the high-frequency components can be weakened, and the texture trend differences of the qualified wood sample image and the existing defect feature image tend to be consistent.
In an optional implementation manner of this embodiment, the step of adjusting the texture feature of the boundary region of the synthesized existing defect feature image further includes the following steps:
and carrying out image processing on the boundary area by using a trained artificial intelligence model, so that the image style of the boundary area comes from the existing defect characteristic image, and the image content of the boundary area comes from the qualified wood sample image.
In this optional implementation, an artificial intelligence model, such as a convolutional neural network, may be trained, and the artificial intelligence model may be used to perform style migration on the image of the boundary region, so as to migrate the existing defect feature image to the qualified wood sample image. After training, content representation and style representation in the convolutional neural network can be well separated, a high-level feature response result in the convolutional neural network can be used as content representation, and the relation between different features of different layers in the convolutional neural network can be used as style representation. For example, an image is constructed by matching the style representation of the existing defect feature image through two VGG networks, and the average square distance of the gram matrix of the qualified wood sample image and the gram matrix of the generated image is minimized on a white noise image by using a gradient descent algorithm.
FIG. 6 is a schematic diagram of a VGG convolutional neural network in accordance with an embodiment of the present disclosure. As shown in fig. 6, the VGG network has 19 layers, the feature space is provided by 16 convolutional layers and 5 pooling layers,
Figure GDA0002923479600000101
in order to input the defect image,
Figure GDA0002923479600000102
in order to provide a circular envelope at the interface region,
Figure GDA0002923479600000103
an image is generated for the ring envelope that is continuously obtained through gradient descent.
The image information can be more obvious through the artificial intelligence model, and the content of the image and the natural style of the image are separated and then combined through the artificial intelligence model, so that the synthesized image has higher quality and is closer to a real image.
In an optional implementation manner of this embodiment, the step of synthesizing the existing defect feature image and the qualified wood sample data to obtain the defective wood sample data of the same wood category as the qualified wood sample data further includes the following steps:
generating marking data of the sample data of the defective wood; the marking data comprises defect marks and wood categories in the qualified wood sample data.
In this optional implementation, after the existing defect feature image is synthesized onto the qualified wood sample image, the obtained defective wood sample image may be labeled, for example, whether the defective wood sample is defective, the defect type, and the like, and the defect type of the defective wood sample may be labeled as the wood type of the qualified wood sample. By the method, the same kind of defective wood sample data can be obtained from the qualified wood sample data, the defective wood sample is expanded, and the problem that the defective wood sample is difficult to obtain under the actual condition is solved.
In an optional implementation manner of this embodiment, the method further includes the following steps:
training based on the qualified wood sample data and the defect sample data to obtain a wood defect identification model; alternatively, the first and second electrodes may be,
training based on the qualified wood sample data and the defect sample data to obtain an identification model of the wood defects, and outputting the identification model of the wood defects to a client.
In the optional implementation mode, after the defective wood sample data is obtained, the qualified wood sample data and the defective wood sample data can be respectively used as a positive sample and a negative sample to train the artificial intelligent model, and after the number of the positive sample and the number of the negative sample are accumulated to a certain degree, the wood defect identification model capable of identifying the wood defects can be obtained. If the wood defect identification model is obtained through cloud training, the wood defect identification model can be output to a client, so that the client can use the model to identify wood.
In an optional implementation manner of this embodiment, the method further includes the following steps: and outputting the sample data of the defective wood to a client.
In the optional implementation mode, after the defective wood sample data is obtained, the defective wood sample data can be output to the client, and the client trains the artificial intelligent model by using the defective wood sample data, so that a wood defect identification model with high identification capability is finally obtained.
The method for acquiring the wood defect sample is suitable for the condition that the wood processing plant does not have enough or can not collect enough sample data of the defective wood, and the wood defect sample can be acquired by requesting the cloud system or directly acquiring a wood defect identification model from the cloud system.
The cloud system can collect qualified wood sample data and defective wood sample data from a plurality of different wood processing plant clients, and when a request is made by the client, the client synthesizes the defective wood sample data or directly provides a trained wood defect identification model for the client according to the request of the client. Along with the accumulation of the defective wood samples of the cloud system, the cloud system can balance the number of different wood species in the defective wood sample data, and the situation that the performance of the artificial intelligence model is affected due to the unbalanced distribution of the defect types of the synthesized new defective wood samples is avoided. For example, the wood defect types can be classified into joints, dead knots, decay, cracks, insect pests and the like, and if the sample number of the joints, dead knots and decay types in the cloud database is high and the sample number of the crack and insect pest types is low, the cloud database can directionally accumulate the defective wood samples of the crack and insect pest types.
In the specific application process, the wood factory carries out category marking on the collected qualified wood samples. The wood grain type of the qualified wood sample can be various wood grains such as cross grains, vertical grains, twills, envelope grains and the like, and the wood grain type can also be various wood grains such as camphor wood, birch wood, rosewood, oak and the like, so that the wood grain type label of the qualified wood sample can also include the wood grain type, such as { camphor wood, cross grains }, { camphor wood, vertical grains }, { birch wood, twills }, { birch wood, envelope grains }, { rosewood, vertical grains }, { rosewood, envelope grains } and the like.
In the cloud system, when a newly synthesized defective wood sample is labeled, the defect type in the labeling data can be directly copied and synthesized into the defect type of the used existing defect characteristic image, and the wood type in the labeling data can be changed into the wood type of the qualified wood sample used in the synthesis. For example, after the qualified wood sample of camphor wood and the crack defect wood sample of birch wood are synthesized, the labeled data can be { camphor wood, crack }.
The artificial intelligence model may employ a neural network. There are two ways in which the neural network can be trained. First, the cloud trains a neural network based on all labeled samples. Second, the factory trains a local neural network directly based on all labeled samples.
For the first training mode, the cloud end can also transmit the trained neural network to a wood factory through the network, or only provides wood classification service for the wood factory at the cloud end.
For the second training mode, the factory can also continue to train existing neural networks to extend wood recognition capabilities to new wood species.
In the early stage of neural network training, the neural network cannot work under the conditions that wood samples are few and defective wood samples are very few, and if the neural network waits for a certain number of samples to be accumulated, the neural network cannot perform wood classification work for a long time. Or, even if the neural network is trained to a certain stage, the synthesis of the defective wood samples at the cloud has an obvious effect on improving the performance of the neural network, because the distribution of the defective wood samples in the total samples is unbalanced, the number of the defective wood samples is far smaller than that of the qualified wood samples, and the types of the defective wood samples are single, so that the trained neural network has no sufficient capacity of identifying the defective wood. And through the synthesis of the cloud defective wood sample, the recognition capability of the trained neural network on the defective wood is greatly improved, and the recognition capability is equivalent to that of the qualified wood. For example, if the number of qualified wood samples is 100, wherein the number of horizontal grain 30, vertical grain 25, diagonal grain 25, envelope grain 20, and the number of defective wood samples is 0, the recognition capability of the neural network is: transverse lines 0.9, vertical lines 0.85, diagonal lines 0.85, enveloping lines 0.8 and defects 0, wherein after the defective wood samples are synthesized by a cloud, the number of the defective wood samples is 100, and the number of the defective wood samples is equal to 25, 20 dead knots, 20 decayed stones, 20 cracks and 15 insect pests, so that the recognition capability of the neural network is as follows: 0.9 transverse striation, 0.85 vertical striation, 0.85 diagonal striation, 0.8 enveloping striation, 0.8 movable joint, 0.75 dead joint, 0.75 rotten, 0.75 crack and 0.7 insect pest.
Or, for a neural network with good wood defect recognition capability, when the neural network faces a new wood species, the performance of the neural network is similar to that of the neural network at the initial training stage, and at the moment, the cloud defect wood sample synthesis service has important significance.
With the increasing acquisition quantity of new wood samples, the increasing quantity of the wood-lacking samples, the increasing proportion of the number of the wood-lacking samples to the total samples, the increasing balance of the category distribution of the wood-lacking samples, and the enough number of the locally acquired wood-lacking samples to support the neural network to identify various types of wood defects, the wood factory can not rely on the synthetic service of the cloud-side wood-lacking samples any more.
The following are embodiments of the disclosed apparatus that may be used to perform embodiments of the disclosed methods.
Fig. 7 shows a block diagram of a structure of a wood defect sample acquiring device according to an embodiment of the present disclosure, which may be implemented as part or all of an electronic device by software, hardware, or a combination of both. As shown in fig. 7, the wood defect sample acquiring apparatus includes a first acquiring module 701, a second acquiring module 702, and a synthesizing module 703:
a first obtaining module 701 configured to obtain qualified wood sample data;
a second obtaining module 702, configured to obtain an existing defect feature image according to qualified wood sample data; the existing defect characteristic image is obtained from an existing defect wood sample database;
a synthesizing module 703 configured to synthesize the existing defect feature image and the qualified wood sample data to obtain defect wood sample data that is the same as the wood category of the qualified wood sample data.
In an optional implementation manner of this embodiment, the second obtaining module includes:
a first obtaining sub-module, configured to obtain, in the existing defective wood sample database, a second existing defective wood sample data that is different from the wood category of the qualified wood sample data from the existing defective wood sample database when the number of first existing defective wood sample data that is the same as the wood category of the qualified wood sample data is less than or equal to a first preset threshold;
an extraction submodule configured to extract the existing defect feature image from the second existing defect wood sample data.
In an optional implementation manner of this embodiment, the apparatus further includes:
a third obtaining module, configured to, when the number of first existing defective wood sample data in the existing defective wood sample database, which is the same as the wood category of the qualified wood sample data, is greater than a first preset threshold, take the first existing defective wood sample data as the defective wood sample data.
In an optional implementation manner of this embodiment, the qualified wood sample data includes a qualified wood sample image and label data; the synthesis module comprises:
and the synthesis submodule is configured to cover part or all of the existing defect characteristic image on a preset area of the qualified wood sample image to obtain defect wood sample data which is the same as the wood category of the qualified wood sample data.
In an optional implementation manner of this embodiment, the apparatus further includes:
and the adjusting module is configured to adjust the texture features of the boundary area of the synthesized existing defect feature image, so that the difference between the texture features of the boundary area and the texture features of the existing defect feature image and/or the texture features of the qualified wood sample is smaller than a second preset threshold value.
In an optional implementation manner of this embodiment, the adjusting module includes:
a filtering submodule configured to filter the textural features of the junction region with a low pass filter.
In an optional implementation manner of this embodiment, the adjusting module includes:
and the image processing submodule is configured to perform image processing on the boundary area by using a trained artificial intelligence model, so that the image style of the boundary area comes from the existing defect characteristic image, and the image content of the boundary area comes from the qualified wood sample image.
In an optional implementation manner of this embodiment, the synthesizing module further includes:
the labeling submodule is configured to generate labeling data of the defective wood sample data; the marking data comprises defect marks and wood categories in the qualified wood sample data.
In an optional implementation manner of this embodiment, the apparatus further includes:
a first training module configured to train to obtain a wood defect identification model based on the qualified wood sample data and the defect sample data; alternatively, the first and second electrodes may be,
and the second training module is configured to train to obtain a wood defect identification model based on the qualified wood sample data and the defect sample data, and output the wood defect identification model to the client.
In an optional implementation manner of this embodiment, the apparatus further includes:
an output module configured to output the defective wood sample data to a client.
The above-mentioned wood defect sample obtaining apparatus corresponds to the wood defect sample obtaining method described in the embodiment shown in fig. 1 and the related parts, and specific details can be referred to the description of the wood defect sample obtaining method, which is not described herein again.
Fig. 8 is a schematic structural diagram of an electronic device suitable for implementing a wood defect sample acquisition method according to an embodiment of the present disclosure.
As shown in fig. 8, the electronic apparatus 800 includes a Central Processing Unit (CPU)801 that can execute various processes in the embodiment shown in fig. 1 described above according to a program stored in a Read Only Memory (ROM)802 or a program loaded from a storage section 808 into a Random Access Memory (RAM) 803. In the RAM803, various programs and data necessary for the operation of the electronic apparatus 800 are also stored. The CPU801, ROM802, and RAM803 are connected to each other via a bus 804. An input/output (I/O) interface 805 is also connected to bus 804.
The following components are connected to the I/O interface 805: an input portion 806 including a keyboard, a mouse, and the like; an output section 807 including a signal such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, and a speaker; a storage portion 808 including a hard disk and the like; and a communication section 809 including a network interface card such as a LAN card, a modem, or the like. The communication section 809 performs communication processing via a network such as the internet. A drive 810 is also connected to the I/O interface 805 as necessary. A removable medium 811 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 810 as necessary, so that a computer program read out therefrom is mounted on the storage section 808 as necessary.
In particular, according to embodiments of the present disclosure, the method described above with reference to fig. 1 may be implemented as a computer software program. For example, embodiments of the present disclosure include a computer program product comprising a computer program tangibly embodied on a medium readable thereby, the computer program comprising program code for performing the method of fig. 1. In such an embodiment, the computer program may be downloaded and installed from a network via the communication section 809 and/or installed from the removable medium 811.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowcharts or block diagrams may represent a module, a program segment, or a portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units or modules described in the embodiments of the present disclosure may be implemented by software or hardware. The units or modules described may also be provided in a processor, and the names of the units or modules do not in some cases constitute a limitation of the units or modules themselves.
As another aspect, the present disclosure also provides a computer-readable storage medium, which may be the computer-readable storage medium included in the apparatus in the above-described embodiment; or it may be a separate computer readable storage medium not incorporated into the device. The computer readable storage medium stores one or more programs for use by one or more processors in performing the methods described in the present disclosure.
The foregoing description is only exemplary of the preferred embodiments of the disclosure and is illustrative of the principles of the technology employed. It will be appreciated by those skilled in the art that the scope of the invention in the present disclosure is not limited to the specific combination of the above-mentioned features, but also encompasses other embodiments in which any combination of the above-mentioned features or their equivalents is possible without departing from the inventive concept. For example, the above features and (but not limited to) the features disclosed in this disclosure having similar functions are replaced with each other to form the technical solution.

Claims (20)

1. A method for obtaining a wood defect sample is characterized by comprising the following steps:
acquiring qualified wood sample data;
acquiring an existing defect characteristic image according to qualified wood sample data; the existing defect characteristic image is obtained from an existing defect wood sample database; when the number of first existing defective wood sample data of which the wood category is the same as that of the qualified wood sample data in the existing defective wood sample database is less than or equal to a first preset threshold value, obtaining second existing defective wood sample data which is different from that of the qualified wood sample data from the existing defective wood sample database; extracting the existing defect characteristic image from the second existing defect wood sample data;
performing style migration on the image of the boundary area through the trained convolutional neural network artificial intelligence model, migrating the existing defect characteristic image to the qualified wood sample data, and synthesizing to obtain the defective wood sample data with the same wood category as the qualified wood sample data; after the convolutional neural network is trained, a high-level feature response result is used as content representation, and the relation between different features of different levels is used as style representation.
2. The method of claim 1, further comprising:
and in the existing defective wood sample database, when the number of first existing defective wood sample data of which the wood category is the same as that of the qualified wood sample data is greater than a first preset threshold value, taking the first existing defective wood sample data as the defective wood sample data.
3. The method according to claim 1, wherein the qualified wood sample data includes a qualified wood sample image and labeling data; the synthesizing obtains defective wood sample data of the same wood category as the qualified wood sample data, including:
and covering part or all of the existing defect characteristic image on a preset area of the qualified wood sample image to obtain defect wood sample data with the same wood category as that of the qualified wood sample data.
4. The method of claim 3, further comprising:
and adjusting the texture features of the boundary region of the synthesized existing defect feature image, so that the difference between the texture features of the boundary region and the texture features of the existing defect feature image and/or the texture features of the qualified wood sample is smaller than a second preset threshold value.
5. The method for obtaining the wood defect sample according to claim 4, wherein the adjusting the texture characteristics of the boundary area of the synthesized existing defect characteristic image comprises:
and filtering the texture features of the boundary region by using a low-pass filter.
6. The method for obtaining a wood defect sample according to claim 4, wherein the adjusting the texture feature of the boundary area of the existing defect feature image on the qualified wood sample image comprises:
and carrying out image processing on the boundary area by using a trained artificial intelligence model, so that the image style of the boundary area comes from the existing defect characteristic image, and the image content of the boundary area comes from the qualified wood sample image.
7. The method according to claim 1, wherein the synthesizing obtains defective wood sample data that is the same as the wood category of the qualified wood sample data, further comprising:
generating marking data of the sample data of the defective wood; the marking data comprises defect marks and wood categories in the qualified wood sample data.
8. The method of claim 1, further comprising:
training based on the qualified wood sample data and the defect sample data to obtain a wood defect identification model; alternatively, the first and second electrodes may be,
training based on the qualified wood sample data and the defect sample data to obtain an identification model of the wood defects, and outputting the identification model of the wood defects to a client.
9. The method of claim 1, further comprising:
and outputting the sample data of the defective wood to a client.
10. A wood defect sample acquisition device, comprising:
a first obtaining module configured to obtain qualified wood sample data;
the second acquisition module is configured to acquire an existing defect characteristic image according to qualified wood sample data; the existing defect characteristic image is obtained from an existing defect wood sample database; wherein the second obtaining module comprises: a first obtaining sub-module, configured to obtain, in the existing defective wood sample database, a second existing defective wood sample data that is different from the wood category of the qualified wood sample data from the existing defective wood sample database when the number of first existing defective wood sample data that is the same as the wood category of the qualified wood sample data is less than or equal to a first preset threshold; an extraction submodule configured to extract the existing defect feature image from the second existing defect wood sample data;
the synthesis module is configured to perform style migration on the image of the boundary area through the trained convolutional neural network artificial intelligence model, migrate the existing defect characteristic image to the qualified wood sample data, and synthesize to obtain defect wood sample data with the same wood category as the qualified wood sample data; after the convolutional neural network is trained, a high-level feature response result is used as content representation, and the relation between different features of different levels is used as style representation.
11. The wood defect sample acquisition device of claim 10, further comprising:
a third obtaining module, configured to, when the number of first existing defective wood sample data in the existing defective wood sample database, which is the same as the wood category of the qualified wood sample data, is greater than a first preset threshold, take the first existing defective wood sample data as the defective wood sample data.
12. The wood defect sample acquisition device of claim 10, wherein the qualified wood sample data comprises a qualified wood sample image and annotation data; the synthesis module comprises:
and the synthesis submodule is configured to cover part or all of the existing defect characteristic image on a preset area of the qualified wood sample image to obtain defect wood sample data which is the same as the wood category of the qualified wood sample data.
13. The wood defect sample acquisition device of claim 12, further comprising:
and the adjusting module is configured to adjust the texture features of the boundary area of the synthesized existing defect feature image, so that the difference between the texture features of the boundary area and the texture features of the existing defect feature image and/or the texture features of the qualified wood sample is smaller than a second preset threshold value.
14. The wood defect sample acquisition device of claim 13, wherein the adjustment module comprises:
a filtering submodule configured to filter the textural features of the junction region with a low pass filter.
15. The wood defect sample acquisition device of claim 13, wherein the adjustment module comprises:
and the image processing submodule is configured to perform image processing on the boundary area by using a trained artificial intelligence model, so that the image style of the boundary area comes from the existing defect characteristic image, and the image content of the boundary area comes from the qualified wood sample image.
16. The wood defect sample acquisition device of claim 10, wherein the synthesis module further comprises:
the labeling submodule is configured to generate labeling data of the defective wood sample data; the marking data comprises defect marks and wood categories in the qualified wood sample data.
17. The wood defect sample acquisition device of claim 10, further comprising:
a first training module configured to train to obtain a wood defect identification model based on the qualified wood sample data and the defect sample data; alternatively, the first and second electrodes may be,
and the second training module is configured to train to obtain a wood defect identification model based on the qualified wood sample data and the defect sample data, and output the wood defect identification model to the client.
18. The wood defect sample acquisition device of claim 10, further comprising:
an output module configured to output the defective wood sample data to a client.
19. An electronic device comprising a memory and a processor; wherein the content of the first and second substances,
the memory is configured to store one or more computer instructions, wherein the one or more computer instructions are executed by the processor to implement the method steps of any of claims 1-9.
20. A computer-readable storage medium having stored thereon computer instructions, characterized in that the computer instructions, when executed by a processor, carry out the method steps of any of claims 1-9.
CN201810240671.3A 2018-03-22 2018-03-22 Wood defect sample obtaining method and device, electronic equipment and storage medium Active CN108447054B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810240671.3A CN108447054B (en) 2018-03-22 2018-03-22 Wood defect sample obtaining method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810240671.3A CN108447054B (en) 2018-03-22 2018-03-22 Wood defect sample obtaining method and device, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN108447054A CN108447054A (en) 2018-08-24
CN108447054B true CN108447054B (en) 2021-06-29

Family

ID=63196126

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810240671.3A Active CN108447054B (en) 2018-03-22 2018-03-22 Wood defect sample obtaining method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN108447054B (en)

Families Citing this family (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109409414B (en) * 2018-09-28 2019-10-15 北京达佳互联信息技术有限公司 Sample image determines method and apparatus, electronic equipment and storage medium
CN110059549A (en) * 2019-03-11 2019-07-26 齐鲁工业大学 A kind of thin wood plate categorizing system and algorithm based on deep learning
CN110223277A (en) * 2019-05-28 2019-09-10 深圳新视智科技术有限公司 Method, apparatus, terminal device and the storage medium that image generates
CN110675359A (en) * 2019-06-29 2020-01-10 创新奇智(南京)科技有限公司 Defect sample generation method and system for steel coil surface and electronic equipment
CN111144244B (en) * 2019-12-13 2023-07-11 唐美(北京)文化科技发展有限公司 Furniture wood category identification method and device
CN111681162B (en) * 2020-06-09 2023-09-01 创新奇智(成都)科技有限公司 Defect sample generation method and device, electronic equipment and storage medium
TWI743837B (en) * 2020-06-16 2021-10-21 緯創資通股份有限公司 Training data increment method, electronic apparatus and computer-readable medium
CN113674249A (en) * 2021-08-24 2021-11-19 重庆忽米网络科技有限公司 PCB printing quality detection method based on industrial internet
CN114596314A (en) * 2022-05-09 2022-06-07 合肥联亚制衣有限公司 Training method, device, equipment and medium for cloth flaw detection model
CN115240031B (en) * 2022-07-21 2023-10-27 无锡锤头鲨智能科技有限公司 Board surface defect generation method and system based on generation countermeasure network

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103258218A (en) * 2013-05-28 2013-08-21 清华大学 Matte detection frame generation method and device and defect detection method and device
CN107358636A (en) * 2017-06-16 2017-11-17 华南理工大学 A kind of rarefaction defect image generating method based on textures synthesis

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106770321B (en) * 2016-12-08 2019-07-19 广东工业大学 A kind of plastic part defect inspection method based on multi-threshold section

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103258218A (en) * 2013-05-28 2013-08-21 清华大学 Matte detection frame generation method and device and defect detection method and device
CN107358636A (en) * 2017-06-16 2017-11-17 华南理工大学 A kind of rarefaction defect image generating method based on textures synthesis

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
基于Markov随机场的木材表面缺陷图像分割方法;白雪冰等;《林业科技》;20130731;第38卷(第4期);33-36 *

Also Published As

Publication number Publication date
CN108447054A (en) 2018-08-24

Similar Documents

Publication Publication Date Title
CN108447054B (en) Wood defect sample obtaining method and device, electronic equipment and storage medium
US11276162B2 (en) Surface defect identification method and apparatus
CN111626947A (en) Map vectorization sample enhancement method and system based on generation of countermeasure network
EP3843036A1 (en) Sample labeling method and device, and damage category identification method and device
CN109241867B (en) Method and device for recognizing digital rock core image by adopting artificial intelligence algorithm
CN112766110A (en) Training method of object defect recognition model, object defect recognition method and device
CN110059539A (en) A kind of natural scene text position detection method based on image segmentation
CN112001901A (en) Apple defect detection method and system based on convolutional neural network
CN115223054A (en) Remote sensing image change detection method based on partition clustering and convolution
CN115131664A (en) Concrete fine crack identification method
CN117252842A (en) Aircraft skin defect detection and network model training method
CN109145955B (en) A kind of Wood Identification Method and system
CN116309612B (en) Semiconductor silicon wafer detection method, device and medium based on frequency decoupling supervision
CN113256608A (en) Workpiece defect detection method and device
CN108805884A (en) A kind of mosaic area's detection method, device and equipment
CN116824274A (en) Small sample fine granularity image classification method and system
CN112836724A (en) Object defect recognition model training method and device, electronic equipment and storage medium
CN114003493A (en) Test data processing method, device, equipment and storage medium
CN112287787B (en) Crop lodging grading method based on gradient histogram characteristics
CN114693554A (en) Big data image processing method and system
CN113139932B (en) Deep learning defect image identification method and system based on ensemble learning
CN114863274A (en) Surface green net thatch cover extraction method based on deep learning
CN114782822A (en) Method and device for detecting state of power equipment, electronic equipment and storage medium
CN112465817B (en) Pavement crack detection method based on directional filter
CN115861160A (en) Method and device for detecting surface defects of power interface of mobile phone and storage medium

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