CN112308802A - Image analysis method and system based on big data - Google Patents
Image analysis method and system based on big data Download PDFInfo
- Publication number
- CN112308802A CN112308802A CN202011314779.6A CN202011314779A CN112308802A CN 112308802 A CN112308802 A CN 112308802A CN 202011314779 A CN202011314779 A CN 202011314779A CN 112308802 A CN112308802 A CN 112308802A
- Authority
- CN
- China
- Prior art keywords
- image
- label
- gray
- images
- labels
- 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.)
- Withdrawn
Links
- 238000003703 image analysis method Methods 0.000 title claims abstract description 23
- 238000000034 method Methods 0.000 claims abstract description 47
- 238000010191 image analysis Methods 0.000 claims abstract description 35
- 238000012545 processing Methods 0.000 claims abstract description 30
- 238000006243 chemical reaction Methods 0.000 claims abstract description 13
- 238000013135 deep learning Methods 0.000 claims abstract description 13
- 238000013527 convolutional neural network Methods 0.000 claims description 26
- 230000011218 segmentation Effects 0.000 claims description 24
- 238000002372 labelling Methods 0.000 claims description 22
- 239000011159 matrix material Substances 0.000 claims description 10
- 238000012886 linear function Methods 0.000 claims description 4
- 230000001174 ascending effect Effects 0.000 claims description 3
- 230000002708 enhancing effect Effects 0.000 claims description 2
- 230000002238 attenuated effect Effects 0.000 description 6
- 238000004891 communication Methods 0.000 description 4
- 238000010586 diagram Methods 0.000 description 3
- 238000002474 experimental method Methods 0.000 description 3
- 238000001914 filtration Methods 0.000 description 3
- 238000004458 analytical method Methods 0.000 description 2
- 238000005516 engineering process Methods 0.000 description 2
- 239000004973 liquid crystal related substance Substances 0.000 description 2
- 230000003287 optical effect Effects 0.000 description 2
- 238000012360 testing method Methods 0.000 description 2
- 239000003086 colorant Substances 0.000 description 1
- 238000013136 deep learning model Methods 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 238000011156 evaluation Methods 0.000 description 1
- 230000003203 everyday effect Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000011084 recovery Methods 0.000 description 1
- 238000011160 research Methods 0.000 description 1
- 239000002699 waste material Substances 0.000 description 1
Images
Classifications
-
- G06T5/90—
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/24—Querying
- G06F16/245—Query processing
- G06F16/2455—Query execution
- G06F16/24552—Database cache management
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/27—Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/04—Architecture, e.g. interconnection topology
- G06N3/045—Combinations of networks
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/10—Segmentation; Edge detection
- G06T7/136—Segmentation; Edge detection involving thresholding
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/90—Determination of colour characteristics
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/20—Special algorithmic details
- G06T2207/20081—Training; Learning
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/20—Special algorithmic details
- G06T2207/20084—Artificial neural networks [ANN]
Abstract
The invention relates to the technical field of image analysis, and discloses an image analysis method based on big data, which comprises the following steps: acquiring a mass of images, and converting the images into gray-scale images by using a gray-scale image conversion method; carrying out binarization processing on the gray level map by using a local maximum inter-class variance method to obtain a binarized image; carrying out enhancement processing on the binary image by using an image enhancement algorithm based on red channel compensation to obtain an enhanced image; marking the image labels by using an image marking algorithm based on deep learning, and storing the images and the image labels in a distributed database; and caching the images and the image labels in the distributed database into the system by utilizing a path-based caching algorithm, so that more efficient image analysis and retrieval are realized. The invention also provides an image analysis system based on the big data. The invention realizes image analysis based on big data.
Description
Technical Field
The invention relates to the technical field of image analysis, in particular to an image analysis method and system based on big data.
Background
With the advent of the big data age, a large amount of image data is generated every day in the internet. The traditional database cannot store and process a mass data set, so that the image data in the internet is stored and analyzed by using a big data technology, which becomes a hot topic in the current research field.
The image under the special environment is fuzzy, and the analysis processing of the image is difficult to carry out, such as an underwater image, in the prior art, the underwater image is repaired mainly from two aspects of chrominance adjustment and contrast enhancement, and a certain effect is achieved in some scenes, but the method still appears to be very effective in the aspects of considering the effectiveness, robustness and instantaneity of a recovery algorithm.
Meanwhile, the default conventional cache algorithm including the LRU in the currently mainstream data processing system cannot effectively meet the application characteristics and real-time requirements in the current environment, and is easy to cause low hit rate, unnecessary I/O overhead and resource waste, mainly because the cache algorithms mostly do not fully utilize data in the data parallel system to rely on semantic information, but rely on the conventional local information based on data item recent access information, frequency information and the like for cache management.
In view of this, how to perform more efficient storage and retrieval on massive images and perform more accurate analysis and processing on blurred images becomes a problem to be solved by those skilled in the art.
Disclosure of Invention
The invention provides an image analysis method based on big data, which is characterized in that an image enhancement algorithm based on red channel compensation is utilized to enhance an image in a special environment, and an image labeling algorithm based on deep learning is utilized to label an image label, so that the image and the image label are stored in a distributed database; meanwhile, images and image labels in the distributed database are cached in the system by utilizing a cache algorithm based on a path, so that more efficient image retrieval is realized.
In order to achieve the above object, the present invention provides an image analysis method based on big data, including:
acquiring a mass of images, and converting the images into gray-scale images by using a gray-scale image conversion method;
carrying out binarization processing on the gray level map by using a local maximum inter-class variance method to obtain a binarized image;
carrying out enhancement processing on the binary image by using an image enhancement algorithm based on red channel compensation to obtain an enhanced image;
marking the image labels by using an image marking algorithm based on deep learning, and storing the images and the image labels in a distributed database;
and caching the images and the image labels in the distributed database into the system by utilizing a path-based caching algorithm, so that more efficient image analysis and retrieval are realized.
Optionally, the converting the image into the gray-scale map by using a gray-scale map conversion method includes:
in one embodiment of the present invention, the types of the images include, but are not limited to, landscape images, face images, animal images, and images in a special environment, such as underwater images, foggy day images, and the like;
the gray scale map conversion formula of the image is as follows:
Gray(i,j)=R(i,j)×0.314+G(i,j)×0.591+B(i,j)×0.113
wherein:
R(i,j),G(j,j),B(i,j)the pixel values of the image pixel (i, j) in the three color components of R, G and B;
Gray(i,j)is the gray value of pixel (i, j).
Optionally, the binarizing processing the gray scale map by using a local maximum inter-class variance method includes:
1) calculating the average gray of the gray map:
wherein:
the M multiplied by N pixels are the size of the gray scale image;
k represents a gray level of the gray map;
ρ (k) is the probability of the occurrence of a pixel with a gray level k;
n (k) is the number of pixels with a gray level k;
2) taking the gray level m as a segmentation threshold, taking the threshold smaller than the segmentation threshold as a background, and taking the threshold larger than or equal to the segmentation threshold as a foreground, so as to divide the gray image into the foreground and the background, wherein the gray value of the background is as follows:
the background number ratio is:
the foreground gray value is:
the foreground number ratio is:
3) calculate the variance of foreground and background:
σ=wb×(μb-μ)2+wf×(μf-μ)2
and modifying the segmentation threshold value m to enable the variance between the foreground and the background to be maximum, wherein the segmentation threshold value at the moment is the optimal segmentation threshold value, and performing binarization segmentation processing on the gray level image by using the optimal segmentation threshold value to obtain a binarization image.
Optionally, the enhancing the binarized image by using an image enhancement algorithm based on red channel compensation includes:
1) calculating the ratio of the intensity attenuation in different color channels:
wherein:
br,bg,bbwavelengths corresponding to RGB three color channels are respectively 620nm, 540nm and 450 nm;
cr,cg,cbintensity attenuation coefficients corresponding to RGB three color channels;
Br,∞,Bg,∞,Bb,∞the method is characterized in that the background light of RGB three-color channels at infinity is obtained, and the intensity of 0.1% of pixel points with the largest numerical value in each channel is taken as a background light value;
2) calculating color compensation coefficients of different color channels:
3) compensating a red channel in the binary image based on color compensation coefficients of different color channels:
R=αr×R+αg×G+αb×B
wherein:
r, G and B are pixel values of image pixels in R, G and B color channel components respectively;
r' is the compensated red channel component pixel value;
for example, if the red component itself is not severely attenuated, then the other components compensate for the lesser component; if the red component is attenuated to the extent that details are lost, information in a red channel can be compensated through the attenuation relation among the channels in the mode, so that the compensation of the red component is effectively carried out to realize the enhancement of the image aiming at the problem that the background is in a blue-green tone caused by the rapid attenuation of the red component in the underwater image;
4) because the edge information of the binary image is fuzzy, the invention carries out filtering processing on the binary image q through a guide image I, so that the final output image is similar to the binary image q in general, but the texture part is similar to the guide image I, and the output image p and the guide image I can be represented by the following local linear model:
pi=ak·Ii+bk
wherein:
i, k are pixel indexes;
a and b are coefficients of a linear function when the filter window is located at k;
in a specific embodiment of the invention, the green channel with rich edge information is used as a guide image, and the compensated red channel is refined to obtain a final red channel compensated enhanced image RGF。
Optionally, the implementing, by using an image annotation algorithm based on deep learning, the annotation of the image tag includes:
1) the number of the predefined image labels is Y, and the image labels are in the predefined image labelsOne or more of (a); dividing an image C to be labeled into a plurality of image blocks { x1,...,xi,., performing label prediction on the image block by using a convolutional neural network, and if the current convolutional neural network model is used for predicting the image block x, performing label prediction on the image block xiPrediction probability of pjThen image block xjThe entropy of information of (a) is defined as:
wherein:
pi,krepresenting image blocks x of a convolutional neural network modeliThe probability of predicting as an image label k;
2) computing different image blocks xiAnd xjThe diversity between:
wherein:
pi,krepresenting image blocks x of a convolutional neural network modeliThe probability of predicting as an image label k;
the diversity d (i, j) is used to evaluate the image block xiAnd xjThe higher the amount of information overlapped therebetween, the lower the amount of information overlapped therebetween, for
3) In a specific embodiment of the present invention, in order to avoid the influence of noise samples generated in the image enhancement process, the robustness of the classification labeling method is significantly enhanced, and the average value of the prediction confidence of all image labels is calculated according to the prediction value of the current convolutional neural network model to the image block set:
wherein:
m is the total number of image blocks;
if beta is larger than 0.5, selecting the first 25% of image blocks to label the image label, or selecting the second 25% of image blocks to label the image label;
4) constructing a label matrix of the label image to be labeled according to the selected image block:
wherein:
eirepresenting image blocks xiThe entropy of the information of (1);
d (i, j) represents an image block xiAnd xjThe diversity between;
according to the constructed label matrix, the invention selects the five numbers with the maximum value, and finds out the corresponding image block and the image label identified by the convolutional neural network, thereby taking the image label as the label of the label image to be labeled.
Optionally, the caching the image and the image tag in the distributed database into the system by using a path-based caching algorithm includes:
1) constructing an image and an image label as a directed acyclic graph G ═ V, E, wherein V is a node set representing the image, and E is a set representing the image label;
2) calculating the caching cost of the image and the image label, and arranging the image and the image label according to the ascending order of the caching cost, wherein the arrangement result is a data caching queue, and the computing formula of the caching cost is as follows:
wherein:
t(ni,j) Representing the execution time of the ith image and the image label to the cache node j;
w(nj) I/O cost for ith image and image label;
Vithe caching cost of the ith image and the image label is represented;
3) calculating a subsequent reference count lrc (j) of the image in the data cache queue, wherein the subsequent reference count is the subsequent calling times of the image and the label;
4) for two different images A and B in the data buffer queue, if lrc (A) > VBAdjusting A to be before B; and adjusting the sequence of all the images in the data buffer queue, and storing the adjusted queue into a system buffer.
In addition, to achieve the above object, the present invention also provides an image analysis system based on big data, the system comprising:
the image acquisition device is used for acquiring mass images;
the image processor is used for converting the image into a gray image by using a gray image conversion method and carrying out binarization processing on the gray image by using a local maximum inter-class variance method to obtain a binarized image; carrying out enhancement processing on the binary image by using an image enhancement algorithm based on red channel compensation;
the image analysis device is used for realizing the labeling of the image labels by utilizing an image labeling algorithm based on deep learning, storing the images and the image labels into the distributed database, and caching the images and the image labels in the distributed database into the system by utilizing a cache algorithm based on a path, so that the more efficient image analysis and retrieval are realized.
In addition, to achieve the above object, the present invention also provides a computer readable storage medium having stored thereon program instructions for image analysis, the program instructions being executable by one or more processors to implement the steps of the implementation method for image analysis based on big data as described above.
Compared with the prior art, the invention provides an image analysis method based on big data, and the technology has the following advantages:
firstly, an image acquired under a special environment is fuzzy, for example, the problem that the background is in a blue-green tone due to the rapid attenuation of a red component in an underwater image is solved. In the algorithm provided by the invention, the ratio of intensity attenuation in corresponding color channels is calculated based on the wavelengths of different colors and background light, and the color compensation coefficients of the different color channels are obtained according to the ratio of intensity attenuation:
wherein c isr,cg,cbIntensity attenuation coefficients corresponding to RGB three color channels; compensating a red channel in the binary image based on color compensation coefficients of different color channels:
R‘=αr×R+αg×G+αb×B
wherein: r, G and B are pixel values of image pixels in R, G and B color channel components respectively; r' is the compensated red channel component pixel value; for example, if the red component itself is not severely attenuated, then the other components compensate for the lesser component; if the red component is attenuated to the extent that details are lost, information in a red channel can be compensated through the attenuation relation among the channels in such a way, so that the compensation of the red component is effectively carried out to realize the enhancement of the image aiming at the problem that the background is in a blue-green tone caused by the rapid attenuation of the red component in the underwater image.
Because the edge information of the binary image is fuzzy, the invention carries out filtering processing on the binary image q through a guide image I, so that the final output image is similar to the binary image q in general, but the texture part is similar to the guide image I, and the output image p and the guide image I can be represented by the following local linear model:
pi=ak·Ii+bk
wherein: i, k are pixel indexes; a and b are coefficients of a linear function when the filter window is located at k; in a specific embodiment of the invention, the green channel with rich edge information is used as a guide image, and the compensated red channel is refined to obtain a final red channel compensated enhanced image RGF。
Meanwhile, the invention provides an image label labeling algorithm based on the entropy of the image block information, which is characterized in that an image to be labeled is divided into a plurality of image blocks, so that label prediction is carried out on different image blocks by using a convolutional neural network model, and if the convolutional neural network model carries out label prediction on an image block xiPrediction probability of piThen image block xiThe entropy of information of (a) is defined as:
wherein: p is a radical ofi,kRepresenting image blocks x of a convolutional neural network modeliThe probability of predicting as an image label k; while using the diversity d (i, j) for evaluating the image block xiAnd xjIn a specific embodiment of the present invention, in order to avoid the influence of noise samples generated during the image enhancement process, the robustness of the classification labeling method is significantly enhanced, and according to the predicted values of the current convolutional neural network model to the image block set, the present invention calculates the average value of the prediction confidence of all image labels:
wherein: m is the total number of image blocks; if beta is larger than 0.5, the prediction confidence coefficient is high, the image blocks of the first 25 percent are selected for labeling the image labels, otherwise, the image blocks of the last 25 percent are selected for labeling the image labels; constructing a label matrix of the label image to be labeled according to the selected image block:
wherein: e.g. of the typeiRepresenting image blocks xiThe entropy of the information of (1); d (i, j) represents an image block xiAnd xjThe diversity between; according to the constructed label matrix, five numbers with the maximum value are selected from the label matrix, and the corresponding image block and the image label identified by the convolutional neural network are found, so that the image label is used as the label of the label image to be labeled; compared with the prior art, the reliability of the image label prediction is labeled according to the convolutional neural network, the reliability of the label prediction depends on the information entropy of the image block, the image label is labeled, if the reliability of the prediction is high, the label with the front prediction probability is selected for labeling, otherwise, the label with the back prediction probability is selected for labeling, and the problem that the label labeling error of the large-scale image is caused by the error of the convolutional neural network is solved.
Drawings
Fig. 1 is a schematic flowchart of an image analysis method based on big data according to an embodiment of the present invention;
fig. 2 is a schematic structural diagram of an image analysis system based on big data according to an embodiment of the present invention;
the implementation, functional features and advantages of the objects of the present invention will be further explained with reference to the accompanying drawings.
Detailed Description
It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
The image under a special environment is enhanced by using an image enhancement algorithm based on red channel compensation, and the labeling of an image label is realized by using an image labeling algorithm based on deep learning, so that the image and the image label are stored in a distributed database; meanwhile, images and image labels in the distributed database are cached in the system by utilizing a cache algorithm based on a path, so that more efficient image retrieval is realized. Fig. 1 is a schematic diagram illustrating an image analysis method based on big data according to an embodiment of the present invention.
In this embodiment, the image analysis method based on big data includes:
and S1, acquiring mass images, and converting the images into gray-scale images by using a gray-scale image conversion method.
Firstly, acquiring a mass of images, and converting the acquired mass of images into a gray-scale image by using a gray-scale image conversion method; in one embodiment of the present invention, the types of the images include, but are not limited to, landscape images, face images, animal images, and images in a special environment, such as underwater images, foggy day images, and the like;
the gray scale map conversion formula of the image is as follows:
Gray(i,j)=R(i,j)×0.314+G(i,j)×0.591+B(i,j)×0.113
wherein:
R(i,j),G(i,j),B(i,j)the pixel values of the image pixel (i, j) in the three color components of R, G and B;
Gray(i,j)is the gray value of the pixel (j, j).
And S2, carrying out binarization processing on the gray-scale image by using a local maximum inter-class variance method to obtain a binarized image.
Further, the invention uses a local maximum inter-class variance method to carry out binarization processing on the gray-scale map, and the binarization processing flow of the gray-scale map comprises the following steps:
1) calculating the average gray of the gray map:
wherein:
the M multiplied by N pixels are the size of the gray scale image;
k represents a gray level of the gray map;
ρ (k) is the probability of the occurrence of a pixel with a gray level k;
n (k) is the number of pixels with a gray level k;
2) taking the gray level m as a segmentation threshold, taking the threshold smaller than the segmentation threshold as a background, and taking the threshold larger than or equal to the segmentation threshold as a foreground, so as to divide the gray image into the foreground and the background, wherein the gray value of the background is as follows:
the background number ratio is:
the foreground gray value is:
the foreground number ratio is:
3) calculate the variance of foreground and background:
σ=wb×(μb-μ)2+wf×(μf-μ)2
and modifying the segmentation threshold value m to enable the variance between the foreground and the background to be maximum, wherein the segmentation threshold value at the moment is the optimal segmentation threshold value, and performing binarization segmentation processing on the gray level image by using the optimal segmentation threshold value to obtain a binarization image.
And S3, performing enhancement processing on the binary image by using an image enhancement algorithm based on red channel compensation to obtain an enhanced image.
Further, the invention utilizes an image enhancement algorithm based on red channel compensation to carry out enhancement processing on the binary image;
the image enhancement algorithm based on red channel compensation comprises the following steps:
1) calculating the ratio of the intensity attenuation in different color channels:
wherein:
br,bg,bbwavelengths corresponding to RGB three color channels are respectively 620nm, 540nm and 450 nm;
cr,cg,cbintensity attenuation coefficients corresponding to RGB three color channels;
Br,∞,Bg,∞,Bb,∞the background light of the RGB three-color channel at infinity is provided, and in a specific embodiment of the invention, the intensity of 0.1% of pixel points with the maximum numerical value in each channel is taken as a background light value;
2) calculating color compensation coefficients of different color channels:
3) compensating a red channel in the binary image based on color compensation coefficients of different color channels:
R‘=αr×R+αg×G+αb×B
wherein:
r, G and B are pixel values of image pixels in R, G and B color channel components respectively;
r' is the compensated red channel component pixel value;
for example, if the red component itself is not severely attenuated, then the other components compensate for the lesser component; if the red component is attenuated to the extent that details are lost, information in a red channel can be compensated through the attenuation relation among the channels in the mode, so that the compensation of the red component is effectively carried out to realize the enhancement of the image aiming at the problem that the background is in a blue-green tone caused by the rapid attenuation of the red component in the underwater image;
4) because the edge information of the binary image is fuzzy, the invention carries out filtering processing on the binary image q through a guide image I, so that the final output image is similar to the binary image q in general, but the texture part is similar to the guide image I, and the output image p and the guide image I can be represented by the following local linear model:
pi=ak·Ii+bk
wherein:
i, k are pixel indexes;
a and b are coefficients of a linear function when the filter window is located at k;
in a specific embodiment of the invention, the green channel with rich edge information is used as a guide image, and the compensated red channel is refined to obtain a final red channel compensated enhanced image RGF。
And S4, realizing the labeling of the image labels by using an image labeling algorithm based on deep learning, and storing the images and the image labels in a distributed database.
Furthermore, the invention realizes the labeling of the image label by using the image label based on the deep learning, and in a specific embodiment of the invention, a deep learning model for labeling the image label is a convolutional neural network model; the image annotation algorithm process based on deep learning comprises the following steps:
1) the number of the predefined image labels is Y, and the image labels are one or more of the predefined image labels; dividing an image C to be labeled into a plurality of image blocks { x1,...,xi,., performing label prediction on the image block by using a convolutional neural network, and if the current convolutional neural network model is used for predicting the image block x, performing label prediction on the image block xiPrediction probability of piThen image block xiThe entropy of information of (a) is defined as:
wherein:
pi,krepresenting image blocks x of a convolutional neural network modeliThe probability of predicting as an image label k;
2) computing different image blocks xiAnd xjThe diversity between:
wherein:
pi,krepresenting image blocks x of a convolutional neural network modeliThe probability of predicting as an image label k;
the diversity d (i, j) is used to evaluate the image block xjAnd xjThe higher the amount of information overlapped therebetween, the lower the amount of information overlapped therebetween, for
3) In a specific embodiment of the present invention, in order to avoid the influence of noise samples generated in the image enhancement process, the robustness of the classification labeling method is significantly enhanced, and the average value of the prediction confidence of all image labels is calculated according to the prediction value of the current convolutional neural network model to the image block set:
wherein:
m is the total number of image blocks;
if beta is larger than 0.5, selecting the first 25% of image blocks to label the image label, or selecting the second 25% of image blocks to label the image label;
4) constructing a label matrix of the label image to be labeled according to the selected image block:
wherein:
eirepresenting image blocks xiThe entropy of the information of (1);
d (i, j) represents an image block xiAnd xjThe diversity between;
according to the constructed label matrix, five numbers with the maximum value are selected from the label matrix, and the corresponding image block and the image label identified by the convolutional neural network are found, so that the image label is used as the label of the label image to be labeled;
5) storing the images and the image labels in a distributed database; in a specific embodiment of the present invention, the distributed databases are a Hadoop database, a MyCat database, and the like.
And S5, caching the images and the image labels in the distributed database into the system by using a path-based caching algorithm, so as to realize more efficient image analysis and retrieval.
Furthermore, the invention utilizes a caching algorithm based on a path to cache the image and the image label in the distributed database into the system, and the caching algorithm based on the path comprises the following processes:
1) constructing an image and an image label as a directed acyclic graph G ═ V, E, wherein V is a node set representing the image, and E is a set representing the image label;
2) calculating the caching cost of the image and the image label, and arranging the image and the image label according to the ascending order of the caching cost, wherein the arrangement result is a data caching queue, and the computing formula of the caching cost is as follows:
wherein:
t(ni,j) Representing the execution time of the ith image and the image label to the cache node j;
w(ni) I/O cost for ith image and image label;
Vithe caching cost of the ith image and the image label is represented;
3) calculating a subsequent reference count lrc (i) of the image in the data cache queue, wherein the subsequent reference count is the subsequent calling times of the image and the label;
4) for two different images A and B in the data buffer queue, if lrc (A) > VBAdjusting A to be before B; and adjusting the sequence of all the images in the data buffer queue, and storing the adjusted queue into a system buffer.
The following describes embodiments of the present invention through an algorithmic experiment and tests of the inventive treatment method. The hardware test environment of the algorithm of the invention is as follows: inter (R) core (TM) i7-6700K CPU with software python 3.6; the comparison method is an image analysis method based on an FFNN model, an image analysis method based on a VGG16 model and an image analysis method based on an AlexNet model.
In the algorithm experiment of the invention, the data set is 5000 pieces of image data. In the experiment, the image data is input into the algorithm model, and the accuracy of image tag identification is used as an evaluation index of feasibility of the method.
According to the experimental result, the image label identification accuracy of the FFNN model-based image analysis method is 86.31%, the image label identification accuracy of the VGG16 model-based image analysis method is 88.32%, the image label identification accuracy of the AlexNet model-based image analysis method is 87.99%, the image label identification accuracy of the method is 92.22%, and compared with a comparison algorithm, the big data-based image analysis method provided by the invention has higher image label identification accuracy.
The invention also provides an image analysis system based on the big data. Fig. 2 is a schematic diagram illustrating an internal structure of a big data-based image analysis system according to an embodiment of the present invention.
In the present embodiment, the big data based image analysis system 1 includes at least an image acquisition device 11, an image processor 12, an image analysis device 13, a communication bus 14, and a network interface 15.
The image capturing device 11 may be a PC (Personal Computer), a terminal device such as a smart phone, a tablet Computer, or a mobile Computer, or may be a server.
The communication bus 14 is used to enable connection communication between these components.
The network interface 15 may optionally include a standard wired interface, a wireless interface (e.g., WI-FI interface), and is typically used to establish a communication link between the system 1 and other electronic devices.
Optionally, the system 1 may further comprise a user interface, which may comprise a Display (Display), an input unit such as a Keyboard (Keyboard), and optionally a standard wired interface, a wireless interface. Alternatively, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an OLED (Organic Light-Emitting Diode) touch device, or the like. The display, which may also be referred to as a display screen or display unit, is suitable for displaying information processed in the big data based image analysis system 1 and for displaying a visualized user interface.
While FIG. 2 only shows the image analysis system 1 with components 11-15 and based on big data, it will be understood by those skilled in the art that the configuration shown in FIG. 1 does not constitute a limitation of the image analysis system 1 based on big data, and may include fewer or more components than shown, or combine certain components, or a different arrangement of components.
In the embodiment of apparatus 1 shown in FIG. 2, image processor 12 has stored therein image analysis program instructions; the steps of the image analysis device 13 executing the image analysis program instructions stored in the image processor 12 are the same as the implementation method of the image analysis method based on big data, and are not described here.
Furthermore, an embodiment of the present invention also provides a computer-readable storage medium having stored thereon image analysis program instructions executable by one or more processors to implement the following operations:
acquiring a mass of images, and converting the images into gray-scale images by using a gray-scale image conversion method;
carrying out binarization processing on the gray level map by using a local maximum inter-class variance method to obtain a binarized image;
carrying out enhancement processing on the binary image by using an image enhancement algorithm based on red channel compensation to obtain an enhanced image;
marking the image labels by using an image marking algorithm based on deep learning, and storing the images and the image labels in a distributed database;
and caching the images and the image labels in the distributed database into the system by utilizing a path-based caching algorithm, so that more efficient image analysis and retrieval are realized.
It should be noted that the above-mentioned numbers of the embodiments of the present invention are merely for description, and do not represent the merits of the embodiments. And the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, apparatus, article, or method that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, apparatus, article, or method. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, apparatus, article, or method that includes the element.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium (e.g., ROM/RAM, magnetic disk, optical disk) as described above and includes instructions for enabling a terminal device (e.g., a mobile phone, a computer, a server, or a network device) to execute the method according to the embodiments of the present invention.
The above description is only a preferred embodiment of the present invention, and not intended to limit the scope of the present invention, and all modifications of equivalent structures and equivalent processes, which are made by using the contents of the present specification and the accompanying drawings, or directly or indirectly applied to other related technical fields, are included in the scope of the present invention.
Claims (8)
1. A method for big data based image analysis, the method comprising:
acquiring a mass of images, and converting the images into gray-scale images by using a gray-scale image conversion method;
carrying out binarization processing on the gray level map by using a local maximum inter-class variance method to obtain a binarized image;
carrying out enhancement processing on the binary image by using an image enhancement algorithm based on red channel compensation to obtain an enhanced image;
marking the image labels by using an image marking algorithm based on deep learning, and storing the images and the image labels in a distributed database;
and caching the images and the image labels in the distributed database into the system by utilizing a path-based caching algorithm, so that more efficient image analysis and retrieval are realized.
2. The big data-based image analysis method as claimed in claim 1, wherein said converting the image into the gray-scale map using the gray-scale map conversion method comprises:
the gray scale map conversion formula of the image is as follows:
Gray(i,j)=R(i,j)×0.314+G(i,j)×0.591+B(i,j)×0.113
wherein:
R(j,j),G(i,j),B(i,j)the pixel values of the image pixel (i, j) in the three color components of R, G and B;
Gray(i,j)is the gray value of pixel (i, j).
3. The big data-based image analysis method as claimed in claim 2, wherein the binarizing process for the gray map by using the local maximum inter-class variance method comprises:
1) calculating the average gray of the gray map:
wherein:
the M multiplied by N pixels are the size of the gray scale image;
k represents a gray level of the gray map;
ρ (k) is the probability of the occurrence of a pixel with a gray level k;
n (k) is the number of pixels with a gray level k;
2) taking the gray level m as a segmentation threshold, taking the threshold smaller than the segmentation threshold as a background, and taking the threshold larger than or equal to the segmentation threshold as a foreground, so as to divide the gray image into the foreground and the background, wherein the gray value of the background is as follows:
the background number ratio is:
the foreground gray value is:
the foreground number ratio is:
3) calculate the variance of foreground and background:
σ=wb×(μb-μ)2+wf×(μf-μ)2
and modifying the segmentation threshold value m to enable the variance between the foreground and the background to be maximum, wherein the segmentation threshold value at the moment is the optimal segmentation threshold value, and performing binarization segmentation processing on the gray level image by using the optimal segmentation threshold value to obtain a binarization image.
4. The big data-based image analysis method as claimed in claim 3, wherein the enhancing the binarized image by using the image enhancement algorithm based on red channel compensation comprises:
1) calculating the ratio of the intensity attenuation in different color channels:
wherein:
br,bg,bbwavelengths corresponding to RGB three color channels are respectively 620nm, 540nm and 450 nm;
cr,cg,cbintensity attenuation coefficients corresponding to RGB three color channels;
Br,∞,Bg,∞,Bb,∞the backlight is background light of light rays of RGB three color channels at infinity;
2) calculating color compensation coefficients of different color channels:
3) compensating a red channel in the binary image based on color compensation coefficients of different color channels:
R‘=αr×R+αg×G+αb×B
wherein:
r, G and B are pixel values of image pixels in R, G and B color channel components respectively;
r' is the compensated red channel component pixel value;
4) taking the green channel with rich edge information as a guide image, thinning the compensated red channel to obtain a final red channel compensated enhanced image RGFEnhancing the image RGFAnd the guide image I can be represented by the following local linear model:
RGF,i=ak·Ii+bk
wherein:
i, k are pixel indexes;
a and b are coefficients of a linear function when the filter window is located at k.
5. The big data-based image analysis method according to claim 4, wherein the labeling of the image label by using the image labeling algorithm based on the deep learning comprises:
1) the number of the predefined image labels is Y, and the image labels are one or more of the predefined image labels; dividing an image C to be labeled into a plurality of image blocks { x1,...,xi,., performing label prediction on the image block by using a convolutional neural network, and if the current convolutional neural network model is used for predicting the image block x, performing label prediction on the image block xiPrediction probability of piThen image block xiThe entropy of information of (a) is defined as:
wherein:
pi,krepresenting image blocks x of a convolutional neural network modeliThe probability of predicting as an image label k;
2) computing different image blocks xiAnd xjThe diversity between:
wherein:
pi,krepresenting image blocks x of a convolutional neural network modeliThe probability of predicting as an image label k;
3) calculating the average value of the prediction confidence degrees of all image labels according to the prediction value of the current convolutional neural network model to the image block set:
wherein:
m is the total number of image blocks;
if beta is larger than 0.5, selecting the first 25% of image blocks to label the image label, or selecting the second 25% of image blocks to label the image label;
4) constructing a label matrix of the label image to be labeled according to the selected image block:
wherein:
eirepresenting image blocks xiThe entropy of the information of (1);
d (i, j) represents an image block xiAnd xjThe diversity between;
and selecting five numbers with the maximum value from the constructed label matrix, and finding out the corresponding image block and the image label identified by the convolutional neural network, thereby taking the image label as the label of the label image to be labeled.
6. The big-data-based image analysis method according to claim 5, wherein the caching the image and the image tag in the distributed database into the system by using a path-based caching algorithm comprises:
1) constructing an image and an image label as a directed acyclic graph G ═ V, E, wherein V is a node set representing the image, and E is a set representing the image label;
2) calculating the caching cost of the image and the image label, and arranging the image and the image label according to the ascending order of the caching cost, wherein the arrangement result is a data caching queue, and the computing formula of the caching cost is as follows:
wherein:
t(ni,j) Representing the i-th image and the execution of the image tag to cache node jTime;
w(ni) I/O cost for ith image and image label;
Vithe caching cost of the ith image and the image label is represented;
3) calculating a subsequent reference count lrc (i) of the image in the data cache queue, wherein the subsequent reference count is the subsequent calling times of the image and the label;
4) for two different images A and B in the data buffer queue, if lrc (A) > VBAdjusting A to be before B; and adjusting the sequence of all the images in the data buffer queue, and storing the adjusted queue into a system buffer.
7. An image analysis system based on big data, the system comprising:
the image acquisition device is used for acquiring mass images;
the image processor is used for converting the image into a gray image by using a gray image conversion method and carrying out binarization processing on the gray image by using a local maximum inter-class variance method to obtain a binarized image; carrying out enhancement processing on the binary image by using an image enhancement algorithm based on red channel compensation;
the image analysis device is used for realizing the labeling of the image labels by utilizing an image labeling algorithm based on deep learning, storing the images and the image labels into the distributed database, and caching the images and the image labels in the distributed database into the system by utilizing a cache algorithm based on a path, so that the more efficient image analysis and retrieval are realized.
8. A computer readable storage medium having stored thereon image analysis program instructions executable by one or more processors to perform the steps of a method of implementing big data based image analysis of any of claims 1 to 6.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011314779.6A CN112308802A (en) | 2020-11-20 | 2020-11-20 | Image analysis method and system based on big data |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011314779.6A CN112308802A (en) | 2020-11-20 | 2020-11-20 | Image analysis method and system based on big data |
Publications (1)
Publication Number | Publication Date |
---|---|
CN112308802A true CN112308802A (en) | 2021-02-02 |
Family
ID=74334336
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202011314779.6A Withdrawn CN112308802A (en) | 2020-11-20 | 2020-11-20 | Image analysis method and system based on big data |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN112308802A (en) |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113436282A (en) * | 2021-06-16 | 2021-09-24 | 湖南国天电子科技有限公司 | Image enhancement type camera |
CN113658302A (en) * | 2021-08-23 | 2021-11-16 | 李帮音 | Three-dimensional animation data processing method and device |
CN113834524A (en) * | 2021-09-10 | 2021-12-24 | 盐城思途云智能科技有限公司 | Method for marking and analyzing scanned image based on big data |
WO2023103291A1 (en) * | 2021-12-08 | 2023-06-15 | 青岛中鸿重型机械有限公司 | Control method for intelligent electric scraper |
-
2020
- 2020-11-20 CN CN202011314779.6A patent/CN112308802A/en not_active Withdrawn
Cited By (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113436282A (en) * | 2021-06-16 | 2021-09-24 | 湖南国天电子科技有限公司 | Image enhancement type camera |
CN113658302A (en) * | 2021-08-23 | 2021-11-16 | 李帮音 | Three-dimensional animation data processing method and device |
CN113658302B (en) * | 2021-08-23 | 2024-04-12 | 麦应俊 | Three-dimensional animation data processing method and device |
CN113834524A (en) * | 2021-09-10 | 2021-12-24 | 盐城思途云智能科技有限公司 | Method for marking and analyzing scanned image based on big data |
WO2023103291A1 (en) * | 2021-12-08 | 2023-06-15 | 青岛中鸿重型机械有限公司 | Control method for intelligent electric scraper |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN112308802A (en) | Image analysis method and system based on big data | |
KR102629380B1 (en) | Method for Distinguishing a Real Three-Dimensional Object from a Two-Dimensional Spoof of the Real Object | |
CN108230346B (en) | Method and device for segmenting semantic features of image and electronic equipment | |
CN112861648B (en) | Character recognition method, character recognition device, electronic equipment and storage medium | |
CN111950723A (en) | Neural network model training method, image processing method, device and terminal equipment | |
CN110222694B (en) | Image processing method, image processing device, electronic equipment and computer readable medium | |
CN112215171B (en) | Target detection method, device, equipment and computer readable storage medium | |
CN108491866B (en) | Pornographic picture identification method, electronic device and readable storage medium | |
CN115443490A (en) | Image auditing method and device, equipment and storage medium | |
CN115860271A (en) | System and method for managing art design scheme | |
CN114169381A (en) | Image annotation method and device, terminal equipment and storage medium | |
CN113222921A (en) | Image processing method and system | |
CN111935487B (en) | Image compression method and system based on video stream detection | |
CN111368632A (en) | Signature identification method and device | |
CN111522979B (en) | Picture sorting recommendation method and device, electronic equipment and storage medium | |
CN112766284A (en) | Image recognition method and device, storage medium and electronic equipment | |
CN117058517A (en) | Helmet detection method, device and medium based on YOLOv5 optimization model | |
CN115240203A (en) | Service data processing method, device, equipment and storage medium | |
CN113012068B (en) | Image denoising method, image denoising device, electronic equipment and computer-readable storage medium | |
US10963690B2 (en) | Method for identifying main picture in web page | |
CN111898544B (en) | Text image matching method, device and equipment and computer storage medium | |
CN113610934B (en) | Image brightness adjustment method, device, equipment and storage medium | |
CN113408517B (en) | Image display method and device and electronic equipment | |
CN114373068A (en) | Industry-scene OCR model implementation system, method and equipment | |
CN114186140A (en) | Social interaction information processing method and device, electronic equipment 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 | ||
WW01 | Invention patent application withdrawn after publication |
Application publication date: 20210202 |
|
WW01 | Invention patent application withdrawn after publication |