CN116385455A - Flotation foam image example segmentation method and device based on gradient field label - Google Patents

Flotation foam image example segmentation method and device based on gradient field label Download PDF

Info

Publication number
CN116385455A
CN116385455A CN202310577993.8A CN202310577993A CN116385455A CN 116385455 A CN116385455 A CN 116385455A CN 202310577993 A CN202310577993 A CN 202310577993A CN 116385455 A CN116385455 A CN 116385455A
Authority
CN
China
Prior art keywords
foam
mask
gradient
gradient field
pixel
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202310577993.8A
Other languages
Chinese (zh)
Other versions
CN116385455B (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.)
University of Science and Technology Beijing USTB
Original Assignee
University of Science and Technology Beijing USTB
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 University of Science and Technology Beijing USTB filed Critical University of Science and Technology Beijing USTB
Priority to CN202310577993.8A priority Critical patent/CN116385455B/en
Publication of CN116385455A publication Critical patent/CN116385455A/en
Application granted granted Critical
Publication of CN116385455B publication Critical patent/CN116385455B/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/10Segmentation; Edge detection
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T11/002D [Two Dimensional] image generation
    • G06T11/40Filling a planar surface by adding surface attributes, e.g. colour or texture
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/136Segmentation; Edge detection involving thresholding
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V20/00Scenes; Scene-specific elements
    • G06V20/70Labelling scene content, e.g. deriving syntactic or semantic representations
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/10Image acquisition modality
    • G06T2207/10004Still image; Photographic image
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20081Training; Learning
    • 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)
  • Theoretical Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Computational Linguistics (AREA)
  • Multimedia (AREA)
  • Image Analysis (AREA)
  • Image Processing (AREA)

Abstract

The invention relates to the technical field of flotation, in particular to a flotation froth image example segmentation method and device based on gradient field labels, comprising the following steps: s1, collecting a flotation foam image, and marking a mask of a foam example level; s2, converting the mask label into a gradient field label which can fit the foam space distribution by using gradient strength; s3, inputting the foam image into a foam instance segmentation network model, predicting a gradient map of the flotation foam image, training and learning the foam instance segmentation network model, and monitoring by using the gradient field label to replace the mask label; s4, converting the predicted gradient map into an example mask to obtain an example level segmentation result. The present invention can effectively divide the foam directly into different foam instances.

Description

Flotation foam image example segmentation method and device based on gradient field label
Technical Field
The invention relates to the technical field of flotation, in particular to a flotation froth image example segmentation method and device based on gradient field labels.
Background
Froth flotation is a common mineral separation technique, and is commonly used for separating minerals such as metal minerals, nonmetallic minerals and rare metals. In the flotation process, based on the chemical and physical property difference of the mineral surface, under the action of proper chemical agents and bubbles, the target mineral is combined with the bubbles to form foam, so that mineral particles rise to the liquid level to form scum, and the purpose of separating the mineral is achieved. Thus, the amount, size, stability, etc. of froth has an important impact on the efficiency and separation efficiency of the flotation process.
In the current beneficiation operation, a flotation worker usually observes foam in a flotation tank, judges working conditions according to the existing self experience, and adopts control operation of changing the added sulfuric acid amount, the chemical agent amount and the like according to different conditions. However, subjectivity and instability of judgment of a flotation worker are difficult to ensure stability of a flotation process and optimality of a flotation effect, namely, mineral utilization rate, medicament consumption proportion and controllable degree of a production process lack objective index guarantee. The segmentation of the flotation froth image can effectively provide more detailed quantitative analysis of the morphology, size, density and the like of the froth, and more useful information is obtained, so that the optimization of the flotation process and the improvement of the separation efficiency are facilitated, and therefore, an effective flotation froth image segmentation method is needed.
Disclosure of Invention
The invention provides a method and a device for dividing a flotation froth image example based on a gradient field label, which are used for dividing the flotation froth image example. The technical scheme is as follows:
in one aspect, a method for segmenting a flotation froth image instance based on gradient field labels is provided, comprising:
s1, collecting a flotation foam image, and marking a mask of a foam example level;
s2, converting the mask label into a gradient field label which can fit the foam space distribution by using gradient strength;
s3, inputting the foam image into a foam instance segmentation network model, predicting a gradient map of the flotation foam image, training and learning the foam instance segmentation network model, and monitoring by using the gradient field label to replace the mask label;
s4, converting the predicted gradient map into an example mask to obtain an example level segmentation result.
Optionally, the step S2 of converting the mask label into a gradient field label capable of fitting the foam spatial distribution by using gradient intensity specifically includes:
s21, taking a mask label graph as input, and acquiring coordinate positions of boundary pixels of each foam mask region marked in the mask label graph;
s22, calculating the mass center of each foam mask and the distance between all pixel points in each foam mask and the mass center according to the coordinate positions of boundary pixels of the foam mask area;
s23, taking the mass center as a gradient center, calculating gradients in the horizontal direction and the vertical direction of each foam mask according to the distance between the pixel points in the foam mask and the mass center, and forming a gradient field label graph, wherein the gradient field label graph reflects the spatial distribution of foam and acts on model training supervision of the foam instance segmentation network model.
Optionally, in S22, calculating the centroid of each foam mask and the distances between all pixel points in each foam mask and the centroid according to the coordinate positions of the boundary pixels of the foam mask area specifically includes:
let the coordinates of boundary pixels of a certain foam mask region be (x) 1 ,y 1 )、(x 2 ,y 2 )、...、(x n ,y n ) Then the centroid coordinates of this foam mask are: x is X C =(1/n)*∑(x i ),Y C =(1/n)*∑(y i ) Where (Xc, yc) is the centroid coordinates and n is the number of pixels of the foam mask,∑(x i ) Sum sigma (y) i ) Respectively representing the sum of x coordinates and y coordinates of all pixel points of the foam mask;
traversing all the pixel points according to the coordinates of the pixel points in each foam mask in the graph, and calculating the distance by adopting a Euclidean distance formula:
Figure BDA0004240649190000021
where (x, y) is the coordinates of the pixel point, (x, y) is the centroid coordinates and distance is the distance of the pixel point from the centroid.
Optionally, in S23, the centroid is taken as a gradient center, and gradients in two directions of horizontal and vertical of each foam mask are calculated according to distances between pixel points in the foam mask and the centroid, so as to form a gradient field label map, which specifically includes:
firstly calculating a thermal force field corresponding to each foam mask, adding a constant value of 1 to the heat source by taking the mass center of each foam mask as the heat source, adopting an eight-neighborhood filling algorithm, filling surrounding pixel points according to the distance sequence, and performing N iterations on the process, wherein N is 2 times of the sum of the pixel length and the width of each foam mask, so as to obtain a thermal value distribution field of each foam mask;
performing horizontal and vertical gradient calculation by utilizing the thermal value distribution of the thermal value distribution field, wherein the horizontal gradient value of each pixel position is the difference between the thermal values of the left pixel and the right pixel in the horizontal direction, and the vertical gradient value of each pixel position is the difference between the thermal values of the upper pixel and the lower pixel in the vertical direction;
and finally, combining the horizontal gradient and the vertical gradient to form a gradient field label graph.
Optionally, the foam instance segmentation network model adopts a mirror symmetry U-shaped network architecture, the first half part of the network utilizes an encoder to extract features, and the second half part utilizes a decoder to carry out regression on the extracted features to obtain a prediction result;
the encoder consists of a downsampling channel, the decoder consists of an upsampling channel, both channels consist of four spatial scales, each spatial scale consists of two residual blocks, each residual block consists of two convolutions, and the convolution kernel size is 3×3;
performing 4 convolution operations on each spatial scale, obtaining a convolution graph each time, performing downsampling on the convolution graph by using maximum pooling, wherein each convolution graph is preceded by a batch norm and Relu operation, and jump connection is performed between two residual blocks by adopting 1X 1 convolution;
after feature extraction is completed by the downsampling channel, before upsampling, carrying out global average pooling on each feature map obtained by the downsampling channel to generate 256-dimensional feature vectors as global features of the image, wherein the global features are obtained by fusing features of different layers and different scales;
on an up-sampling channel, each spatial scale first convolves the output of the previous spatial scale as an input;
adding the global features to the last 3 convolution layers of each spatial scale of up-sampling, selecting the dimensions of different up-sampling spatial scales for linear projection, and performing global broadcasting on the global features at each position in the matched convolution graphs to obtain global features with the corresponding spatial scale;
after each spatial scale completes the first convolution, feature fusion is carried out on the feature of the equivalent level in the downsampling channel, the global feature corresponding to the spatial scale, and the first convolution output of the spatial scale in a splicing mode, the feature fusion is input to the second convolution, and then 3 convolution operations are completed by analogy;
the last spatial scale on the upsampling channel is followed by three parallel 1 x 1 convolutional layers, and finally the prediction results in three outputs, the first two being used to directly predict the horizontal and vertical gradients of the image, and the third being used to predict the probability of the pixel being inside or outside the foam instance individual.
Optionally, in S4, the predicted gradient map is converted into an instance mask, so as to obtain an instance-level segmentation result, which specifically includes:
setting a threshold value for the pixel probability map, and considering only pixels above the threshold value;
filtering and smoothing the gradient field to reduce noise, combining horizontal and vertical gradient field components, and calculating gradient field intensity, wherein the gradient field intensity is more than 0 and is an effective pixel point;
reforming a gradient field, wherein 200 rounds of Euler integral iteration with the step length of 1 is carried out on the effective pixel points along the gradient direction, and after iteration is completed, the effective pixel points are more easily clustered towards the local maximum direction, and coordinate positions and boundaries of different examples are distinguished;
carrying out maximum pooling on the gradient field, and finding out the position of the local maximum value in the gradient field, wherein the pooled value is unchanged and the point with the intensity value larger than 2 is the position of the local maximum value;
and taking a local maximum point as a starting point, taking the direction of a gradient field as a direction, performing flooding filling by using an eight-neighborhood filling algorithm, and performing uniform color filling when the connected areas at the same instance position reach the boundary to distinguish different foams.
Optionally, the foam instance segmentation network model predicts the gradient fields in the horizontal and vertical directions of the foam image and the probability that each pixel is inside or outside the foam instance individual, the prediction result is compared with the gradient field label, the loss of the horizontal component and the vertical component of the gradient field is calculated by using an L2 loss function, the loss of the probability that whether the pixel is inside or outside the foam instance individual is calculated by using cross entropy loss, and the sum of the two is calculated as the loss of model training, so as to counter-propagate update parameters until training is stopped after the loss is minimized, so that the model can accurately predict the gradient field and the pixel probability of the foam image.
In another aspect, there is provided a gradient field tag-based flotation froth image instance segmentation apparatus, comprising:
the collecting and labeling module is used for collecting the flotation foam image and labeling the mask of the foam example level;
the first conversion module is used for converting the mask label into a gradient field label which can fit the foam space distribution by using the gradient strength;
the prediction module is used for inputting the foam image into a foam instance segmentation network model, predicting a gradient map of the flotation foam image, training and learning the foam instance segmentation network model, and monitoring by using the gradient field label to replace the mask label;
and the second conversion module is used for converting the predicted gradient map into an instance mask to obtain an instance-level segmentation result.
In another aspect, an electronic device is provided that includes a processor and a memory having at least one instruction stored therein that is loaded and executed by the processor to implement the gradient field tag-based flotation froth image instance segmentation method described above.
In another aspect, a computer readable storage medium having stored therein at least one instruction loaded and executed by a processor to implement the gradient field tag-based flotation froth image instance segmentation method described above is provided.
Compared with the prior art, the technical scheme has at least the following beneficial effects:
the invention can effectively and directly divide the foam into different foam examples so as to better quantify the visual information of the flotation foam, thereby improving the efficiency and quality of the flotation process, and has the advantages of high division precision and strong robustness, and provides accurate necessary parameter values such as the size, the quantity and the like of the foam for judging the flotation working condition.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for the description of the embodiments will be briefly described below, and it is apparent that the drawings in the following description are only some embodiments of the present invention, and other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 is a flowchart of a method for dividing a flotation froth image example based on a gradient field label according to an embodiment of the present invention;
FIG. 2 is a block diagram of an overall algorithm provided in an embodiment of the present invention;
FIG. 3 is a flowchart of a mask annotation to gradient field labeling provided by an embodiment of the present invention;
FIG. 4 is a network structure diagram of a foam example segmentation network model provided by an embodiment of the present invention;
FIG. 5 is a flowchart of an example mask for gradient field prediction and pixel probability restoration provided by an embodiment of the present invention;
fig. 6 is a block diagram of a flotation froth image segmentation apparatus based on a gradient field label according to an embodiment of the present invention;
fig. 7 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention more clear, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. It will be apparent that the described embodiments are some, but not all, embodiments of the invention. All other embodiments, which can be made by a person skilled in the art without creative efforts, based on the described embodiments of the present invention fall within the protection scope of the present invention.
As shown in fig. 1, an embodiment of the present invention provides a method for segmenting a flotation froth image example based on a gradient field tag, including:
s1, collecting a flotation foam image, and marking a mask of a foam example level;
s2, converting the mask label into a gradient field label which can fit the foam space distribution by using gradient strength;
s3, inputting the foam image into a foam instance segmentation network model, predicting a gradient map of the flotation foam image, training and learning the foam instance segmentation network model, and monitoring by using the gradient field label to replace the mask label;
s4, converting the predicted gradient map into an example mask to obtain an example level segmentation result.
According to the embodiment of the invention, the three-dimensional form of the convex curved surface of the foam is combined, the mask mark of a pure plane is converted into the gradient field label reflecting the space distribution of the foam, and the gradient field label is used for replacing the existing mask as a label to carry out the supervised learning of the foam example segmentation network model of the foam flotation; the foam example segmentation network model is different from the existing method for directly predicting an example mask, predicts the gradient field and pixel probability corresponding to a foam image, recovers the mask by the gradient field, completes the segmentation of an example level, and obtains an accurate segmentation result.
The following describes in detail an example segmentation method of a flotation froth image based on a gradient field tag according to an embodiment of the present invention with reference to fig. 2 to 5, including:
s1, collecting a flotation foam image, and marking a mask of a foam example level;
erecting a high-definition industrial camera on the flotation tank to collect foam images;
performing manual instance-level mask labeling (pure plane) on the acquired foam image, and labeling each foam mask region to obtain a segmentation labeling diagram corresponding to the foam image;
constructing mask labels and original images into a data set, and dividing a training set, a verification set and a test set according to a proportion;
data enhancement is performed on training set samples in an image dataset of flotation froth, and the training samples are augmented with methods including, but not limited to, random horizontal flip, random vertical flip, random multi-scale transform, random angle transform.
S2, converting the mask label into a gradient field label which can fit the foam space distribution by using gradient strength;
optionally, as shown in fig. 3, the step S2 of converting the mask label into a gradient field label capable of fitting the spatial distribution of the foam by using gradient intensity specifically includes:
s21, taking a mask label graph as input, and acquiring coordinate positions of boundary pixels of each foam mask region marked in the mask label graph;
s22, calculating the mass center of each foam mask and the distance between all pixel points in each foam mask and the mass center according to the coordinate positions of boundary pixels of the foam mask area;
let the coordinates of boundary pixels of a certain foam mask region be (x) 1 ,y 1 )、(x 2 ,y 2 )、...、(x n ,y n ) Then the centroid coordinates of this foam mask are: x is X C =(1/n)*∑(x i ),Y C =(1/n)*∑(y i ) Where (Xc, yc) is the centroid coordinate, n is the number of pixels of the foam mask, Σ (x) i ) Sum sigma (y) i ) Respectively representing the sum of x coordinates and y coordinates of all pixel points of the foam mask;
traversing all the pixel points according to the coordinates of the pixel points in each foam mask in the graph, and calculating the distance by adopting a Euclidean distance formula:
Figure BDA0004240649190000071
where (x, y) is the coordinates of the pixel point, (x, y) is the centroid coordinates and distance is the distance of the pixel point from the centroid.
S23, taking the mass center as a gradient center, calculating gradients in the horizontal direction and the vertical direction of each foam mask according to the distance between the pixel points in the foam mask and the mass center, and forming a gradient field label graph, wherein the gradient field label graph reflects the spatial distribution of foam and acts on model training supervision of the foam instance segmentation network model.
Firstly calculating a thermal force field corresponding to each foam mask, adding a constant value of 1 to the heat source by taking the mass center of each foam mask as the heat source, adopting an eight-neighborhood filling algorithm, filling surrounding pixel points according to the distance sequence, and performing N iterations on the process, wherein N is 2 times of the sum of the pixel length and the width of each foam mask, so as to obtain a thermal value distribution field of each foam mask;
performing horizontal and vertical gradient calculation by utilizing the thermal value distribution of the thermal value distribution field, wherein the horizontal gradient value of each pixel position is the difference between the thermal values of the left pixel and the right pixel in the horizontal direction, and the vertical gradient value of each pixel position is the difference between the thermal values of the upper pixel and the lower pixel in the vertical direction;
since the thermal value outside the foam mask is 0, it is obvious that both the horizontal gradient and the vertical gradient value outside the foam mask are 0.
And finally, combining the horizontal gradient and the vertical gradient to form a gradient field label graph.
On the gradient field label graph, gradient changes of foam masks and non-foam mask areas, namely foam and non-foam areas are obvious, boundary lines which are easy to distinguish exist, the gradient field of each foam mask approximates to the curved surface characteristics of the foam, and the gradient field label graph reflects the foam space distribution, so that the method is more beneficial to the example segmentation of learning foam of a supervision model.
S3, inputting the foam image into a foam instance segmentation network model, predicting a gradient map of the flotation foam image, training and learning the foam instance segmentation network model, and monitoring by using the gradient field label to replace the mask label;
optionally, as shown in fig. 4, the foam example segmentation network model adopts a mirror symmetry U-shaped network architecture, the first half of the network uses an encoder to extract features, and the second half uses a decoder to regress the extracted features to obtain a prediction result;
the encoder consists of a downsampling channel, the decoder consists of an upsampling channel, both channels consist of four spatial scales, each spatial scale consists of two residual blocks, each residual block consists of two convolutions, and the convolution kernel size is 3×3;
performing 4 convolution operations on each spatial scale, obtaining a convolution graph each time, performing downsampling on the convolution graph by using maximum pooling, wherein each convolution graph is preceded by a batch norm and Relu operation, and jump connection is performed between two residual blocks by adopting 1X 1 convolution;
after feature extraction is completed by the downsampling channel and before upsampling, carrying out global average pooling on each feature map obtained by the downsampling channel to generate 256-dimensional feature vectors as global features of the image, wherein the global features are obtained by fusing features with different levels and different scales, so that better comprehensive and comprehensive expression can be realized;
due to the obvious scale difference of the foam sizes in the flotation foam image, the method is not beneficial to the segmentation of the foam by the model, extracts global features and fuses the global features into the up-sampling process, is beneficial to the model to learn the feature information of the foam in different scales, and obtains a more accurate example segmentation result.
On an up-sampling channel, each spatial scale first convolves the output of the previous spatial scale as an input;
adding the global features to the last 3 convolution layers of each spatial scale of the up-sampling, selecting the dimensions of different up-sampling spatial scales for linear projection (so that the dimensions of the global features after linear projection are matched with those of the convolution graphs corresponding to the up-sampling), and performing global broadcasting on the global features at each position in the matched convolution graphs to obtain global features with the corresponding spatial scale;
after each spatial scale completes the first convolution, feature fusion is carried out on the feature of the equivalent level in the downsampling channel, the global feature corresponding to the spatial scale, and the first convolution output of the spatial scale in a splicing mode, the feature fusion is input to the second convolution, and then 3 convolution operations are completed by analogy;
the last spatial scale on the upsampling channel is followed by three parallel 1 x 1 convolutional layers, and finally the prediction results in three outputs, the first two being used to directly predict the horizontal and vertical gradients of the image, and the third being used to predict the probability of the pixel being inside or outside the foam instance individual.
S4, converting the predicted gradient map into an example mask to obtain an example level segmentation result.
Optionally, as shown in fig. 5, in S4, the predicted gradient map is converted into an instance mask, so as to obtain an instance-level segmentation result, which specifically includes:
setting a threshold (for example, may be set to 0.5) for the pixel probability map, considering only pixels above the threshold;
filtering and smoothing the gradient field to reduce noise, combining horizontal and vertical gradient field components, and calculating gradient field intensity, wherein the gradient field intensity is more than 0 and is an effective pixel point;
reforming a gradient field, wherein 200 rounds of Euler integral iteration with the step length of 1 is carried out on the effective pixel points along the gradient direction, and after iteration is completed, the effective pixel points are more easily clustered towards the local maximum direction, and coordinate positions and boundaries of different examples are distinguished;
carrying out maximum pooling on the gradient field, and finding out the position of the local maximum value in the gradient field, wherein the pooled value is unchanged and the point with the intensity value larger than 2 is the position of the local maximum value;
and taking a local maximum point as a starting point, taking the direction of a gradient field as a direction, performing flooding filling by using an eight-neighborhood filling algorithm, and performing uniform color filling when the connected areas at the same instance position reach the boundary to distinguish different foams.
Optionally, the foam instance segmentation network model predicts the gradient fields in the horizontal and vertical directions of the foam image and the probability that each pixel is inside or outside the foam instance individual, the prediction result is compared with the gradient field label, the loss of the horizontal component and the vertical component of the gradient field is calculated by using an L2 loss function, the loss of the probability that whether the pixel is inside or outside the foam instance individual is calculated by using cross entropy loss, and the sum of the two is calculated as the loss of model training, so as to counter-propagate update parameters until training is stopped after the loss is minimized, so that the model can accurately predict the gradient field and the pixel probability of the foam image.
All values used in the embodiments of the present invention are preferred examples of the present invention, but the present invention is not limited to these values, and all values are within the protection scope of the embodiments of the present invention.
The embodiment of the invention can respectively evaluate the accuracy of the trained network model by adopting an AP formula.
Calculating an intersection IoU of each predicted mask by matching it with the real mask;
classifying each prediction mask according to a set IoU threshold value of 0.5, classifying the prediction masks with IoU larger than the threshold value as effective matching (TP), wherein the prediction masks with lower threshold value as ineffective matching (FP), and the truth mask with ineffective matching (FN);
and calculating the AP by TP, FP and FN.
Figure BDA0004240649190000101
As shown in fig. 6, the embodiment of the invention further provides a flotation froth image example segmentation device based on gradient field labels, which comprises:
the collection labeling module 610 is used for collecting flotation froth images and labeling masks of froth example levels;
a first conversion module 620 for converting the mask label into a gradient field label capable of fitting a spatial distribution of foam using gradient intensities;
the prediction module 630 is configured to input the foam image into a foam instance segmentation network model, predict a gradient map of the flotation foam image, perform training learning of the foam instance segmentation network model, and replace the mask label with the gradient field label for supervision;
a second conversion module 640, configured to convert the predicted gradient map into an instance mask, to obtain an instance-level segmentation result.
The functional structure of the flotation froth image example segmentation device based on the gradient field label provided by the embodiment of the invention corresponds to the flotation control parameter prediction method based on the multi-mode time sequence information provided by the embodiment of the invention, and is not repeated here.
Fig. 7 is a schematic structural diagram of an electronic device 700 according to an embodiment of the present invention, where the electronic device 600 may have a relatively large difference due to different configurations or performances, and may include one or more processors (central processing units, CPU) 701 and one or more memories 702, where at least one instruction is stored in the memories 702, and the at least one instruction is loaded and executed by the processors 701 to implement the steps of the above-described gradient field tag-based flotation froth image example segmentation method.
In an exemplary embodiment, a computer readable storage medium, such as a memory comprising instructions executable by a processor in a terminal to perform the gradient field tag based flotation froth image instance segmentation method described above, is also provided. For example, the computer readable storage medium may be ROM, random Access Memory (RAM), CD-ROM, magnetic tape, floppy disk, optical data storage device, etc.
It will be understood by those skilled in the art that all or part of the steps for implementing the above embodiments may be implemented by hardware, or may be implemented by a program for instructing relevant hardware, where the program may be stored in a computer readable storage medium, and the storage medium may be a read-only memory, a magnetic disk or an optical disk, etc.
The foregoing description of the preferred embodiments of the invention is not intended to limit the invention to the precise form disclosed, and any such modifications, equivalents, and alternatives falling within the spirit and scope of the invention are intended to be included within the scope of the invention.

Claims (10)

1. A gradient field label-based flotation froth image instance segmentation method, comprising:
s1, collecting a flotation foam image, and marking a mask of a foam example level;
s2, converting the mask label into a gradient field label which can fit the foam space distribution by using gradient strength;
s3, inputting the foam image into a foam instance segmentation network model, predicting a gradient map of the flotation foam image, training and learning the foam instance segmentation network model, and monitoring by using the gradient field label to replace the mask label;
s4, converting the predicted gradient map into an example mask to obtain an example level segmentation result.
2. The method according to claim 1, wherein the step S2 of converting the mask label into a gradient field label capable of fitting a spatial distribution of foam using gradient intensities, comprises:
s21, taking a mask label graph as input, and acquiring coordinate positions of boundary pixels of each foam mask region marked in the mask label graph;
s22, calculating the mass center of each foam mask and the distance between all pixel points in each foam mask and the mass center according to the coordinate positions of boundary pixels of the foam mask area;
s23, taking the mass center as a gradient center, calculating gradients in the horizontal direction and the vertical direction of each foam mask according to the distance between the pixel points in the foam mask and the mass center, and forming a gradient field label graph, wherein the gradient field label graph reflects the spatial distribution of foam and acts on model training supervision of the foam instance segmentation network model.
3. The method according to claim 2, wherein the calculating the centroid of each foam mask and the distances between all pixel points in each foam mask and the centroid in S22 according to the coordinate positions of the boundary pixels of the foam mask region specifically includes:
let the coordinates of boundary pixels of a certain foam mask region be (x) 1 ,y 1 )、(x 2 ,y 2 )、...、(x n ,y n ) Then the centroid coordinates of this foam mask are: x is X C =(1/n)*∑(x i ),Y C =(1/n)*∑(y i ) Where (Xc, yc) is the centroid coordinate, n is the number of pixels of the foam mask, Σ (x) i ) Sum sigma (y) i ) Respectively representing the sum of x coordinates and y coordinates of all pixel points of the foam mask;
traversing all the pixel points according to the coordinates of the pixel points in each foam mask in the graph, and calculating the distance by adopting a Euclidean distance formula:
Figure FDA0004240649160000011
wherein (x, y) is the coordinates of the pixel point and (x, y) is the centroid coordinatesTarget distance is the distance of the pixel point from the centroid.
4. The method according to claim 2, wherein in S23, the centroid is taken as a gradient center, and gradients in both horizontal and vertical directions of each foam mask are calculated according to distances between pixel points in the foam mask and the centroid, so as to form a gradient field label map, which specifically includes:
firstly calculating a thermal force field corresponding to each foam mask, adding a constant value of 1 to the heat source by taking the mass center of each foam mask as the heat source, adopting an eight-neighborhood filling algorithm, filling surrounding pixel points according to the distance sequence, and performing N iterations on the process, wherein N is 2 times of the sum of the pixel length and the width of each foam mask, so as to obtain a thermal value distribution field of each foam mask;
performing horizontal and vertical gradient calculation by utilizing the thermal value distribution of the thermal value distribution field, wherein the horizontal gradient value of each pixel position is the difference between the thermal values of the left pixel and the right pixel in the horizontal direction, and the vertical gradient value of each pixel position is the difference between the thermal values of the upper pixel and the lower pixel in the vertical direction;
and finally, combining the horizontal gradient and the vertical gradient to form a gradient field label graph.
5. The method of claim 1, wherein the foam instance segmentation network model adopts a mirror-symmetrical U-shaped network architecture, the first half of the network uses an encoder to extract features, and the second half uses a decoder to regress the extracted features to obtain a prediction result;
the encoder consists of a downsampling channel, the decoder consists of an upsampling channel, both channels consist of four spatial scales, each spatial scale consists of two residual blocks, each residual block consists of two convolutions, and the convolution kernel size is 3×3;
performing 4 convolution operations on each spatial scale, obtaining a convolution graph each time, performing downsampling on the convolution graph by using maximum pooling, wherein each convolution graph is preceded by a batch norm and Relu operation, and jump connection is performed between two residual blocks by adopting 1X 1 convolution;
after feature extraction is completed by the downsampling channel, before upsampling, carrying out global average pooling on each feature map obtained by the downsampling channel to generate 256-dimensional feature vectors as global features of the image, wherein the global features are obtained by fusing features of different layers and different scales;
on an up-sampling channel, each spatial scale first convolves the output of the previous spatial scale as an input;
adding the global features to the last 3 convolution layers of each spatial scale of up-sampling, selecting the dimensions of different up-sampling spatial scales for linear projection, and performing global broadcasting on the global features at each position in the matched convolution graphs to obtain global features with the corresponding spatial scale;
after each spatial scale completes the first convolution, feature fusion is carried out on the feature of the equivalent level in the downsampling channel, the global feature corresponding to the spatial scale, and the first convolution output of the spatial scale in a splicing mode, the feature fusion is input to the second convolution, and then 3 convolution operations are completed by analogy;
the last spatial scale on the upsampling channel is followed by three parallel 1 x 1 convolutional layers, and finally the prediction results in three outputs, the first two being used to directly predict the horizontal and vertical gradients of the image, and the third being used to predict the probability of the pixel being inside or outside the foam instance individual.
6. The method according to claim 1, wherein the step S4 of converting the predicted gradient map into an instance mask to obtain an instance-level segmentation result specifically includes:
setting a threshold value for the pixel probability map, and considering only pixels above the threshold value;
filtering and smoothing the gradient field to reduce noise, combining horizontal and vertical gradient field components, and calculating gradient field intensity, wherein the gradient field intensity is more than 0 and is an effective pixel point;
reforming a gradient field, wherein 200 rounds of Euler integral iteration with the step length of 1 is carried out on the effective pixel points along the gradient direction, and after iteration is completed, the effective pixel points are more easily clustered towards the local maximum direction, and coordinate positions and boundaries of different examples are distinguished;
carrying out maximum pooling on the gradient field, and finding out the position of the local maximum value in the gradient field, wherein the pooled value is unchanged and the point with the intensity value larger than 2 is the position of the local maximum value;
and taking a local maximum point as a starting point, taking the direction of a gradient field as a direction, performing flooding filling by using an eight-neighborhood filling algorithm, and performing uniform color filling when the connected areas at the same instance position reach the boundary to distinguish different foams.
7. The method of claim 1, wherein the foam instance segmentation network model predicts gradient fields in the horizontal and vertical directions of the foam image and the probability that each pixel is inside or outside the foam instance individual, the prediction results are compared with gradient field labels, the loss of horizontal and vertical components of the gradient fields is calculated using L2 loss functions, the loss of probability of whether a pixel is inside or outside the foam instance individual is calculated using cross entropy loss, and the sum of the two is calculated as a model training loss for back-propagating update parameters until training is stopped after the loss is minimized, so that the model can accurately predict the foam image gradient fields and pixel probabilities.
8. A gradient field tag-based flotation froth image instance segmentation apparatus, comprising:
the collecting and labeling module is used for collecting the flotation foam image and labeling the mask of the foam example level;
the first conversion module is used for converting the mask label into a gradient field label which can fit the foam space distribution by using the gradient strength;
the prediction module is used for inputting the foam image into a foam instance segmentation network model, predicting a gradient map of the flotation foam image, training and learning the foam instance segmentation network model, and monitoring by using the gradient field label to replace the mask label;
and the second conversion module is used for converting the predicted gradient map into an instance mask to obtain an instance-level segmentation result.
9. An electronic device comprising a processor and a memory having at least one instruction stored therein, wherein the at least one instruction is loaded and executed by the processor to implement the gradient field tag-based flotation froth image instance segmentation method according to any one of claims 1 to 7.
10. A computer readable storage medium having stored therein at least one instruction, wherein the at least one instruction is loaded and executed by a processor to implement the gradient field label-based flotation froth image instance segmentation method according to any one of claims 1 to 7.
CN202310577993.8A 2023-05-22 2023-05-22 Flotation foam image example segmentation method and device based on gradient field label Active CN116385455B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310577993.8A CN116385455B (en) 2023-05-22 2023-05-22 Flotation foam image example segmentation method and device based on gradient field label

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310577993.8A CN116385455B (en) 2023-05-22 2023-05-22 Flotation foam image example segmentation method and device based on gradient field label

Publications (2)

Publication Number Publication Date
CN116385455A true CN116385455A (en) 2023-07-04
CN116385455B CN116385455B (en) 2024-01-26

Family

ID=86969592

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310577993.8A Active CN116385455B (en) 2023-05-22 2023-05-22 Flotation foam image example segmentation method and device based on gradient field label

Country Status (1)

Country Link
CN (1) CN116385455B (en)

Citations (25)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101334844A (en) * 2008-07-18 2008-12-31 中南大学 Critical characteristic extraction method for flotation foam image analysis
CN101339659A (en) * 2008-08-22 2009-01-07 北京矿冶研究总院 Region growing image segmentation method based on rules
US20090220137A1 (en) * 2008-02-28 2009-09-03 Siemens Corporate Research, Inc. Automatic Multi-label Segmentation Of Abdominal Images Using Non-Rigid Registration
CN101566848A (en) * 2009-05-27 2009-10-28 中南大学 Fault diagnostic method of floatation process based on statistic distribution of foam size
US20100080430A1 (en) * 2008-09-29 2010-04-01 Carestream Health, Inc Noise suppression in diagnostic images
CN103268622A (en) * 2013-05-21 2013-08-28 南方医科大学 Method for generating distribution image for observing cervix tumor radiotherapy total dose
CN104268600A (en) * 2014-03-11 2015-01-07 中南大学 Mineral flotation froth image texture analysis and working condition identification method based on Minkowski distance
CN106023200A (en) * 2016-05-19 2016-10-12 四川大学 Poisson model-based X-ray chest image rib inhibition method
CN107126211A (en) * 2017-06-07 2017-09-05 上海联影医疗科技有限公司 MR imaging method and system
CN107145874A (en) * 2017-05-13 2017-09-08 复旦大学 Ship Target Detection and discrimination method in complex background SAR image
CN108062756A (en) * 2018-01-29 2018-05-22 重庆理工大学 Image, semantic dividing method based on the full convolutional network of depth and condition random field
CN109584248A (en) * 2018-11-20 2019-04-05 西安电子科技大学 Infrared surface object instance dividing method based on Fusion Features and dense connection network
CN110689020A (en) * 2019-10-10 2020-01-14 湖南师范大学 Segmentation method of mineral flotation froth image and electronic equipment
CN111753912A (en) * 2020-06-28 2020-10-09 中国矿业大学 Coal slime flotation clean coal ash content prediction method based on deep learning
CN112927245A (en) * 2021-04-12 2021-06-08 华中科技大学 End-to-end instance segmentation method based on instance query
CN112949381A (en) * 2021-01-20 2021-06-11 涂益浪 Image content identification method and system
CN113673541A (en) * 2021-10-21 2021-11-19 广州微林软件有限公司 Image sample generation method for target detection and application
CN113705508A (en) * 2021-09-02 2021-11-26 中冶赛迪技术研究中心有限公司 Flotation froth image acquisition and analysis method, system, medium and electronic terminal
CN113837193A (en) * 2021-09-23 2021-12-24 中南大学 Zinc flotation froth image segmentation algorithm based on improved U-Net network
CN114510970A (en) * 2022-01-26 2022-05-17 中南大学 Flotation process working condition identification method based on audio signal characteristics
CN115049923A (en) * 2022-05-30 2022-09-13 北京航空航天大学杭州创新研究院 SAR image ship target instance segmentation training method, system and device
CN115131561A (en) * 2022-07-04 2022-09-30 中南大学 Potassium salt flotation froth image segmentation method based on multi-scale feature extraction and fusion
CN115294379A (en) * 2022-09-29 2022-11-04 南通甘雨钢化玻璃制品有限公司 Flotation method foam identification method based on optical information
CN115359254A (en) * 2022-07-25 2022-11-18 华南理工大学 Vision transform network-based weak supervision instance segmentation method, system and medium
CN115471660A (en) * 2022-09-24 2022-12-13 福州大学 NSST domain infrared target segmentation and SURF matching flotation foam flow velocity detection method

Patent Citations (25)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090220137A1 (en) * 2008-02-28 2009-09-03 Siemens Corporate Research, Inc. Automatic Multi-label Segmentation Of Abdominal Images Using Non-Rigid Registration
CN101334844A (en) * 2008-07-18 2008-12-31 中南大学 Critical characteristic extraction method for flotation foam image analysis
CN101339659A (en) * 2008-08-22 2009-01-07 北京矿冶研究总院 Region growing image segmentation method based on rules
US20100080430A1 (en) * 2008-09-29 2010-04-01 Carestream Health, Inc Noise suppression in diagnostic images
CN101566848A (en) * 2009-05-27 2009-10-28 中南大学 Fault diagnostic method of floatation process based on statistic distribution of foam size
CN103268622A (en) * 2013-05-21 2013-08-28 南方医科大学 Method for generating distribution image for observing cervix tumor radiotherapy total dose
CN104268600A (en) * 2014-03-11 2015-01-07 中南大学 Mineral flotation froth image texture analysis and working condition identification method based on Minkowski distance
CN106023200A (en) * 2016-05-19 2016-10-12 四川大学 Poisson model-based X-ray chest image rib inhibition method
CN107145874A (en) * 2017-05-13 2017-09-08 复旦大学 Ship Target Detection and discrimination method in complex background SAR image
CN107126211A (en) * 2017-06-07 2017-09-05 上海联影医疗科技有限公司 MR imaging method and system
CN108062756A (en) * 2018-01-29 2018-05-22 重庆理工大学 Image, semantic dividing method based on the full convolutional network of depth and condition random field
CN109584248A (en) * 2018-11-20 2019-04-05 西安电子科技大学 Infrared surface object instance dividing method based on Fusion Features and dense connection network
CN110689020A (en) * 2019-10-10 2020-01-14 湖南师范大学 Segmentation method of mineral flotation froth image and electronic equipment
CN111753912A (en) * 2020-06-28 2020-10-09 中国矿业大学 Coal slime flotation clean coal ash content prediction method based on deep learning
CN112949381A (en) * 2021-01-20 2021-06-11 涂益浪 Image content identification method and system
CN112927245A (en) * 2021-04-12 2021-06-08 华中科技大学 End-to-end instance segmentation method based on instance query
CN113705508A (en) * 2021-09-02 2021-11-26 中冶赛迪技术研究中心有限公司 Flotation froth image acquisition and analysis method, system, medium and electronic terminal
CN113837193A (en) * 2021-09-23 2021-12-24 中南大学 Zinc flotation froth image segmentation algorithm based on improved U-Net network
CN113673541A (en) * 2021-10-21 2021-11-19 广州微林软件有限公司 Image sample generation method for target detection and application
CN114510970A (en) * 2022-01-26 2022-05-17 中南大学 Flotation process working condition identification method based on audio signal characteristics
CN115049923A (en) * 2022-05-30 2022-09-13 北京航空航天大学杭州创新研究院 SAR image ship target instance segmentation training method, system and device
CN115131561A (en) * 2022-07-04 2022-09-30 中南大学 Potassium salt flotation froth image segmentation method based on multi-scale feature extraction and fusion
CN115359254A (en) * 2022-07-25 2022-11-18 华南理工大学 Vision transform network-based weak supervision instance segmentation method, system and medium
CN115471660A (en) * 2022-09-24 2022-12-13 福州大学 NSST domain infrared target segmentation and SURF matching flotation foam flow velocity detection method
CN115294379A (en) * 2022-09-29 2022-11-04 南通甘雨钢化玻璃制品有限公司 Flotation method foam identification method based on optical information

Non-Patent Citations (4)

* Cited by examiner, † Cited by third party
Title
LI S 等: "Diversity regularized spatiotemporal attention for video-based person re-identification", 《2018 IEEE/CVF CONFERENCE ON COMPUTER VISION AND PATTERN RECOGNITION.SALT LAKE CITY》, pages 369 *
周开军;阳春华;牟学民;桂卫华;: "一种基于图像特征提取的浮选回收率预测算法", 高技术通讯, no. 09, pages 81 - 87 *
张然;赵凤群;: "考虑分数阶梯度的雾天图像增强偏微分方程模型", 计算机辅助设计与图形学学报, no. 09, pages 57 - 65 *
张超;都玉莹;韩成;白烨;: "融合多线索信息的数字图像抠图方法研究", 计算机工程与应用, no. 17, pages 174 - 179 *

Also Published As

Publication number Publication date
CN116385455B (en) 2024-01-26

Similar Documents

Publication Publication Date Title
CN107292912B (en) Optical flow estimation method based on multi-scale corresponding structured learning
CN111241989B (en) Image recognition method and device and electronic equipment
CN112183414A (en) Weak supervision remote sensing target detection method based on mixed hole convolution
US9959466B2 (en) Object tracking apparatus and method and camera
CN112434618B (en) Video target detection method, storage medium and device based on sparse foreground priori
CN112016605A (en) Target detection method based on corner alignment and boundary matching of bounding box
CN114758288A (en) Power distribution network engineering safety control detection method and device
CN108229494B (en) Network training method, processing method, device, storage medium and electronic equipment
CN111079638A (en) Target detection model training method, device and medium based on convolutional neural network
CN110910445B (en) Object size detection method, device, detection equipment and storage medium
CN112801047B (en) Defect detection method and device, electronic equipment and readable storage medium
CN101908214A (en) Moving object detection method with background reconstruction based on neighborhood correlation
CN110570450B (en) Target tracking method based on cascade context-aware framework
CN116385455B (en) Flotation foam image example segmentation method and device based on gradient field label
JP2011008809A (en) Mobile object recognition method and device
CN112258449A (en) Rapid nodule matching method based on nodule characteristics
CN113514053B (en) Method and device for generating sample image pair and method for updating high-precision map
CN115375901A (en) Image object detection and instance segmentation method, system, computing device and medium
US11908133B2 (en) Method for cell image segmentation using scribble labels, recording medium and device for performing the method
CN108701206B (en) System and method for facial alignment
CN114332473A (en) Object detection method, object detection device, computer equipment, storage medium and program product
CN113837015A (en) Face detection method and system based on feature pyramid
CN116188973B (en) Crack detection method based on cognitive generation mechanism
CN114708513B (en) Edge building extraction method and system considering corner features
Agarwal et al. Comparing U-Net and mask R-CNN algorithms for deep learning-based segmentation of electron microscopy images containing cavities for nuclear reactor applications

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