Search

CN-122023319-A - YOLOv 8-based abalone defect detection method and system

CN122023319ACN 122023319 ACN122023319 ACN 122023319ACN-122023319-A

Abstract

The invention provides a method and a system for detecting abalone defects based on YOLOv <8 >, which specifically comprise the following steps of S1, constructing an abalone dataset containing labeling information for training of an abalone defect detection model, S2, constructing an abalone defect detection model, namely, based on a YOLOv S network, replacing an original PAN-FPN neck network with a BiFPN neck network, replacing a C2f module in a trunk network and a neck network with a CSPNeXt module, replacing fixed interpolation up-sampling of the BiFPN neck network with CARAFE content perception dynamic up-sampling, introducing an attention mechanism and a self-adaptive feature fusion control mechanism between the trunk network and the neck network for controlling the fusion weight of the BiFPN neck network, and S3, carrying out defect detection on the abalone by using the trained abalone defect detection model. The abalone identifying device can quickly and accurately identify and reject unqualified abalones on a production line.

Inventors

  • HUANG XU
  • WU JIANFENG
  • DAI FUQUAN

Assignees

  • 福建理工大学

Dates

Publication Date
20260512
Application Date
20260128

Claims (8)

  1. 1. The YOLOv-based abalone defect detection method is characterized by comprising the following steps of: s1, constructing an abalone data set containing labeling information for training an abalone defect detection model; s2, constructing an abalone defect detection model, namely replacing an original PAN-FPN neck network with a BiFPN neck network based on YOLOv S network, replacing C2f modules in a main network and the neck network with CSPNeXt modules, replacing fixed interpolation upsampling of the BiFPN neck network with CARAFE content perception dynamic upsampling, and introducing an attention mechanism and an adaptive feature fusion control mechanism between the main network and the neck network to control the fusion weight of the BiFPN neck network; S3, performing defect detection on the abalone by using the trained abalone defect detection model.
  2. 2. The method for detecting abalone defects based on YOLOv as claimed in claim 1, wherein constructing the abalone dataset containing labeling information is specifically as follows: S1.1, designing an image acquisition structure to acquire an abalone sample data set, wherein a camera is mounted in a top-mounted overlooking mode and is matched with a dome light source and a deep blue conveyor belt to acquire abalone sample images covering multiple working conditions and multiple forms, the multiple working conditions comprise daytime, night illumination working conditions and different running speed working conditions of the conveyor belt, and the multiple forms comprise different sizes, different water contents, different placing postures and stacking adhesion states of abalones; S1.2, labeling the abalone sample data set, wherein the labeling category comprises breakage and incomplete, a plurality of adhesion and qualification, and performing data enhancement to obtain the abalone data set containing the label information.
  3. 3. A method of detecting abalone defects based on YOLOv as claimed in claim 2, wherein the data enhancement includes rotation, random pixel removal, affine transformation, brightness/contrast, HSV gamut perturbation, noise injection, and synthetic bonding, which refers to the approach of several qualified abalones and the addition of contact shadows.
  4. 4. The method for detecting abalone defects based on YOLOv as defined in claim 1, wherein the abalone defect detection model is specifically as follows: The backbone network comprises a first Conv module, a second Conv module, a first CSPNeXt module, a third Conv module, a second CSPNeXt module, a fourth Conv module, a third CSPNeXt module, a fifth Conv module, a fourth CSPNeXt module, an SPPF module and a CBAM module which are sequentially connected, wherein the second CSPNeXt module, the third CSPNeXt module and the fourth CSPNeXt module respectively output P3-P5 characteristics, and the CBAM module outputs channel attention force and space attention force; The P3-P7 feature adjusts the number of channels to the same dimension through a 1 x1 convolution operation, and then works together with the channel attention diagram and the spatial attention diagram as inputs to a neck network comprising 1 AFC module, 2 CARAFE modules, 4 Concat _ BIFPN modules, 4 CSPNeXt modules, and 2 Conv modules, wherein: The AFC module takes the P4-P7 characteristics, the channel attention force diagram and the space attention force diagram after channel adjustment as input and outputs three groups of weight control coefficients 、 、 The first CARAFE module controls the coefficient by weight And the channel-adjusted P7 feature is used as input, the first Concat _ BIFPN module takes the channel-adjusted P4 feature and the first CARAFE module output feature as input, the fifth CSPNeXt module takes the first Concat _ BIFPN module output feature as input, the second CARAFE module takes the fifth CSPNeXt module output feature as input, the second Concat _ BIFPN module takes the channel-adjusted P3 feature and the second CARAFE module output feature as input, the sixth CARAFE module takes the second Concat _ BIFPN module output feature as input, the eighth Conv module takes the sixth CARAFE module output feature as input, the third Concat _ BIFPN module takes the eighth Conv module output feature and the fifth CSPNeXt module output feature as input, the seventh CSPNeXt module takes the third Concat _ BIFPN module output feature as input, the ninth Conv module takes the seventh CSPNeXt module output feature as input, the fourth Concat _ BIFPN module takes the ninth Conv module output feature, the first CARAFE module output feature and the weight control coefficient as input 、 The eighth CSPNeXt module takes as input the fourth Concat _ BIFPN module output feature; The head network comprises 3 groups of detection heads, and the output characteristics of a sixth CSPNeXt module, a seventh CSPNeXt module and an eighth CSPNeXt module are respectively taken as inputs to obtain a defect detection result.
  5. 5. A method for detecting abalone defects based on YOLOv according to claim 4, wherein the AFC module performs the following operations in particular; Space attention force diagram Vector characterization by global average pooling By channel attention Spatial attention map vector characterization Aggregate derived joint attention vector : Wherein, the Representing a global average pooling of the data, Represents a real number and is used to represent a real number, Representing a feature dimension of a channel attention map; will combine the attention vectors Mapping to a unified dimension d: Wherein, the Representing joint attention vectors The d-dimensional representation after linear mapping, All of which represent the linear mapping transformation parameters, As a matrix of weights, the weight matrix, Is a bias term; The P4-P7 features are mapped to a unified dimension d after global average pooling operation: Wherein, the Representing the P4-P7 feature A scale feature map is provided which is representative of the scale feature map, Represent the first The scale feature map is subjected to global average pooling feature representation, Represent the first The number of channels of the scale feature map, Representation of D-dimensional representation after linear mapping; According to 、 、 Calculating weight control coefficients : Wherein, the Representing control coefficients for predictive weights Is used to determine the vector of the input vector, Representing the Sigmoid activation function, Representing the function of the ReLU activation, 、 Representing AFC for prediction Weight matrix and bias of the first full-connection layer of (c), 、 Representing AFC for prediction Weight matrix and bias of the second full-connection layer of (a); According to 、 Calculating weight control coefficients : Wherein, the Representing control coefficients for predictive weights Is used to determine the vector of the input vector, 、 Representing AFC for prediction Weight matrix and bias of the first full-connection layer of (c), 、 Representing AFC for prediction Weight matrix and bias of the second full-connection layer of (a); According to 、 Calculating weight control coefficients : Wherein, the Representing control coefficients for predictive weights Is used to determine the vector of the input vector, 、 Representing AFC for prediction Weight matrix and bias of the first full-connection layer of (c), 、 Representing AFC for prediction Weight matrix and bias of the second full-connection layer of (a).
  6. 6. The method for detecting abalone defects based on YOLOv as defined in claim 4, wherein the first CARAFE module specifically performs the following operations: Setting CARAFE kernel prediction network to output each position Logits vector of (v) The method comprises the following steps: Wherein, the Representation CARAFE core prediction network for use in accordance with input features Predicting each location Logits, input features In the case of the P7 feature, Representing CARAFE the side length of the dynamic recombination kernel; By using For logits vectors Performing scaling correction to obtain corrected logits vector : For correction logits vector Carrying out Softmax normalization treatment to obtain dynamic recombinant nucleus : Upsampling recombination output: Wherein, the Representing input features In the neighborhood position The characteristic value of the position, Is a dynamic recombination nucleus The element in (a) represents the position For its neighborhood position Is used to determine the dynamic reorganization kernel weight of (1), Expressed in terms of Is central A local neighborhood sampling set, Representing the position of the output features after upsampling of the first CARAFE module The feature value is obtained by neighborhood reorganization weighted summation.
  7. 7. The YOLOv-based abalone defect detection method according to claim 4, wherein the fourth Concat _ BIFPN module specifically performs the following operations: let Concat _ BiFPN node two-way input be Then And The corresponding fusion weights are: Wherein, the Representing the un-normalized fusion weights corresponding to the two paths of input, Representing the pre-normalization intermediate quantity of the fusion weight; normalizing the two paths of input weights: Wherein, the Represents a stable term that prevents the denominator from being 0, Representation pair Carrying out normalized fusion coefficients; the fourth Concat _ BIFPN module fuses the output characteristics Is calculated as follows: Wherein, the Representing the feature integration operation after fusion.
  8. 8. An abalone defect detection system based on YOLOv, comprising a processor, a memory and a computer program stored on the memory, wherein the processor, when executing the computer program, performs the steps of the abalone defect detection method according to any one of claims 1-7.

Description

YOLOv 8-based abalone defect detection method and system Technical Field The invention belongs to computer vision and artificial intelligence, and particularly relates to an abalone defect detection method and system based on YOLOv. Background Through years of development, the aquatic product processing industry in China has greatly advanced. But in general, the aquatic product processing industry in China faces serious challenges in various aspects of technical level, equipment condition, quality control and the like. The technology content of aquaculture processing is improved, diversified aquatic foods are developed, and the technology is developed from 'primary processing' to 'finish and deep processing', so that the technology is a future trend of aquaculture development. Compared with developed countries, the equipment application level in the field of aquatic product processing in China is low, and pain points such as insufficient automation degree, low production efficiency, high energy consumption and the like are commonly existed. Meanwhile, the special processing equipment with independent intellectual property rights and the matched production line are almost blank, the research and development innovation capability of related mechanical equipment is particularly weak, and the core advanced production equipment is dependent on import for a long time, so that the quality improvement and efficiency improvement and high-quality development of the industry are seriously restricted. . Therefore, the method can enable automation, informatization and intelligence of abalone cooked food production, explore a modern manufacturing mode with high quality, low cost and environmental protection, and promote transformation and upgrading of marine industry from aquatic product processing to marine food intelligent manufacturing. In order to solve the problem, the invention provides the abalone defect detection method based on YOLOv, which is oriented to the processing scene of cooked abalone, and can rapidly and accurately identify and reject unqualified abalones on a production line. Disclosure of Invention The invention aims to provide a YOLOv-based abalone defect detection method and a YOLOv-based abalone defect detection system, which can rapidly and accurately identify and reject unqualified abalones on a production line. In order to achieve the above purpose, the technical scheme of the invention is as follows: YOLOv 8-based abalone defect detection method specifically comprises the following steps: s1, constructing an abalone data set containing labeling information for training an abalone defect detection model; s2, constructing an abalone defect detection model, namely replacing an original PAN-FPN neck network with a BiFPN neck network based on YOLOv S network, replacing C2f modules in a main network and the neck network with CSPNeXt modules, replacing fixed interpolation upsampling of the BiFPN neck network with CARAFE content perception dynamic upsampling, and introducing an attention mechanism and an adaptive feature fusion control mechanism between the main network and the neck network to control the fusion weight of the BiFPN neck network; S3, performing defect detection on the abalone by using the trained abalone defect detection model. Preferably, constructing the abalone data set containing the labeling information is specifically as follows: S1.1, designing an image acquisition structure to acquire an abalone sample data set, wherein a camera is mounted in a top-mounted overlooking mode and is matched with a dome light source and a deep blue conveyor belt to acquire abalone sample images covering multiple working conditions and multiple forms, the multiple working conditions comprise daytime, night illumination working conditions and different running speed working conditions of the conveyor belt, and the multiple forms comprise different sizes, different water contents, different placing postures and stacking adhesion states of abalones; S1.2, labeling the abalone sample data set, wherein the labeling category comprises breakage and incomplete, a plurality of adhesion and qualification, and performing data enhancement to obtain the abalone data set containing the label information. Preferably, the data enhancement includes rotation, random pixel removal, affine transformation, brightness/contrast, HSV gamut perturbation, noise injection, and synthetic bonding, which refers to the approach of several qualified abalones and the addition of contact shadows. Preferably, the abalone defect detection model is specifically as follows: The backbone network comprises a first Conv module, a second Conv module, a first CSPNeXt module, a third Conv module, a second CSPNeXt module, a fourth Conv module, a third CSPNeXt module, a fifth Conv module, a fourth CSPNeXt module, an SPPF module and a CBAM module which are sequentially connected, wherein the second CSPNeXt module, the third CSPNeXt module and th