CN112348100B - Rock recognition method, device, equipment and storage medium - Google Patents

Rock recognition method, device, equipment and storage medium Download PDF

Info

Publication number
CN112348100B
CN112348100B CN202011270883.XA CN202011270883A CN112348100B CN 112348100 B CN112348100 B CN 112348100B CN 202011270883 A CN202011270883 A CN 202011270883A CN 112348100 B CN112348100 B CN 112348100B
Authority
CN
China
Prior art keywords
rock
preset
feature vector
identified
class
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202011270883.XA
Other languages
Chinese (zh)
Other versions
CN112348100A (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.)
Sichuan Dinao Technology Co ltd
Chengdu Univeristy of Technology
Original Assignee
Sichuan Dinao Technology Co ltd
Chengdu Univeristy of Technology
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 Sichuan Dinao Technology Co ltd, Chengdu Univeristy of Technology filed Critical Sichuan Dinao Technology Co ltd
Priority to CN202011270883.XA priority Critical patent/CN112348100B/en
Publication of CN112348100A publication Critical patent/CN112348100A/en
Application granted granted Critical
Publication of CN112348100B publication Critical patent/CN112348100B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/24Classification techniques
    • G06F18/241Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches
    • G06F18/2415Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches based on parametric or probabilistic models, e.g. based on likelihood ratio or false acceptance rate versus a false rejection rate
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/21Design or setup of recognition systems or techniques; Extraction of features in feature space; Blind source separation
    • G06F18/214Generating training patterns; Bootstrap methods, e.g. bagging or boosting
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/045Combinations of networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods

Abstract

The application provides a rock identification method, a rock identification device, equipment and a storage medium, and relates to the technical field of rock identification. The method can utilize a convenient website as a tool to identify the rock, eliminates the influence of individual subjective factors, and provides a way for rock enthusiasts to quickly and accurately identify the rock types in the field. Extracting the features of the image of the rock to be identified to obtain a feature vector; judging the rock category to which the feature vector belongs by using a preset rock classification space to obtain an intermediate classification feature vector; calculating the probability that the rocks to be identified belong to different rock categories according to the intermediate classification feature vector to obtain a probability distribution vector; and at least outputting the probability that the rock to be identified belongs to a class of rock categories or the superior class of the rock categories to which the rock to be identified belongs according to the probability distribution vector.

Description

Rock recognition method, device, equipment and storage medium
Technical Field
The present application relates to the field of rock recognition technologies, and in particular, to a rock recognition method, apparatus, device, and storage medium.
Background
Rocks widely exist in nature, and have uses and values of building materials, ornaments, energy materials, and the like. The general public can not identify the rock types because of less cognition on the rock and lack of rock identification knowledge, and the identification expert can identify the rock types according to the characteristics of the rock such as color, mineral composition, structural structure and the like, but can not provide rock identification service anytime and anywhere. Rock appearance can be presented by taking pictures, acquiring rock images and the like, so that a rock identification method, a device, equipment and a storage medium are required to be designed to replace an appraisal expert for rock identification.
Disclosure of Invention
The embodiment of the application provides a rock identification method, a device, equipment and a storage medium, and the application can utilize a convenient website as a tool to identify rocks, eliminates the influence of individual subjective factors, and provides a way for common people of rock enthusiasts to quickly and accurately identify rock types in the field.
The embodiment of the application provides a rock identification method, which comprises the following steps:
extracting the features of the image of the rock to be identified to obtain a feature vector;
judging the rock category to which the feature vector belongs by using a preset rock classification space to obtain an intermediate classification feature vector;
calculating the probability that the rocks to be identified belong to different rock categories according to the intermediate classification feature vector to obtain a probability distribution vector;
and at least outputting the probability that the rock to be identified belongs to a class of rock categories or the superior class of the rock categories to which the rock to be identified belongs according to the probability distribution vector.
Optionally, the method further comprises:
obtaining the picture of the rock to be identified of the uploaded website;
the characteristic extraction is carried out on the picture of the rock to be identified, and the characteristic extraction comprises the following steps:
and in the rock identification interface of the website system, when the trigger operation of the rock identification service is received, extracting the characteristics of the picture of the rock to be identified.
Optionally, outputting at least the probability that the rock to be identified belongs to one rock class or the superior class of the rock class to which the rock to be identified belongs according to the probability distribution vector, includes:
when the probability of any rock category is larger than a first preset threshold value, outputting the probability that the rock to be identified belongs to the any rock category;
when the probabilities of all rock categories are smaller than a first preset threshold value, acquiring a plurality of rock categories of which the probabilities are larger than a second preset threshold value;
and when the plurality of rock types belong to the upper level type of the same rock type, outputting the upper level type of the same rock type.
Optionally, the determining, by using a preset rock classification space, a rock class to which the feature vector belongs includes:
mapping the feature vector to the preset rock classification space to obtain a first projection point of the feature vector in the preset rock classification space;
calculating the distance between the first projection point and a plurality of preset central points in the preset rock classification space; wherein each center point corresponds to a class of rock;
determining a target central point closest to the characteristic vector according to the distance between the first projection point and a plurality of central points preset in the preset rock classification space;
and judging the rock category to which the feature vector belongs according to the rock category of the target central point.
Optionally, the method further comprises:
marking the obtained rock image with a standard rock category to obtain a rock image sample;
performing feature extraction on the rock image sample to obtain a feature vector sample;
inputting the feature vector sample into a high-dimensional space preset with a plurality of central points to obtain a second projection point of the feature vector sample in the high-dimensional space;
calculating the distance between the second projection point and a plurality of preset central points in the high-dimensional space; wherein each center point corresponds to a class of rock;
determining a prediction central point closest to the characteristic vector sample according to the distance between the second projection point and a plurality of central points preset in the high-dimensional space;
and when the rock category of the predicted central point is inconsistent with the standard rock category, adjusting the parameters of the high-dimensional space, and taking the high-dimensional space subjected to multiple parameter adjustments as the preset rock classification space.
Optionally, adjusting parameters of the high-dimensional space includes:
determining a target central point corresponding to the standard rock category;
calculating the loss value of the second projection point and the target central point according to the formula (1);
Figure BDA0002777663070000031
(1) wherein m is the number of rock image samples; x is the number ofiThe position coordinates of the second projection point are obtained; c. CyiThe position coordinates of the target central point are taken as the position coordinates of the target central point;
and adjusting the parameters of the preset high-dimensional space according to the loss value.
A second aspect of embodiments of the present application provides a rock recognition apparatus, including:
the first identification module is used for extracting the characteristics of the image of the rock to be identified to obtain a characteristic vector;
the judging module is used for judging the rock category to which the feature vector belongs by utilizing a preset rock classification space to obtain an intermediate classification feature vector;
the calculation module is used for calculating the probability that the rock to be identified belongs to different rock categories according to the intermediate classification feature vector to obtain a probability distribution vector;
and the output module is used for at least outputting the probability that the rock to be identified belongs to one rock class or the superior class of the rock class to which the rock to be identified belongs according to the probability distribution vector.
Optionally, the apparatus further comprises:
the acquisition module is used for acquiring the pictures of the rocks to be identified, which are uploaded to the website system;
the first identification module comprises:
and the recognition submodule is used for performing feature extraction on the picture of the rock to be recognized when the triggering operation of the rock recognition service is received in the rock recognition interface of the website system.
Optionally, the output module includes:
the first output submodule is used for outputting the probability that the rock to be identified belongs to any rock category when the probability of the rock category is larger than a first preset threshold value;
the obtaining submodule is used for obtaining a plurality of rock categories of which the probability is greater than a second preset threshold when the probabilities of all the rock categories are smaller than the first preset threshold;
and the second output submodule is used for outputting the superior class of the same rock class when the plurality of rock classes belong to the superior class of the same rock class.
Optionally, the determining module includes:
the mapping submodule is used for mapping the feature vector to the preset rock classification space to obtain a first projection point of the feature vector in the preset rock classification space;
the calculation submodule is used for calculating the distances between the first projection point and a plurality of preset central points in the preset rock classification space; wherein each center point corresponds to a class of rock;
the distance determining submodule is used for determining a target central point closest to the characteristic vector according to the distance between the first projection point and a plurality of preset central points in the preset rock classification space;
and the judging submodule is used for judging the rock category to which the feature vector belongs according to the rock category of the target central point.
Optionally, the apparatus further comprises:
the marking module is used for marking the standard rock types of the obtained rock images to obtain rock image samples;
the second identification module is used for extracting the characteristics of the rock image sample to obtain a characteristic vector sample;
the input module is used for inputting the feature vector sample into a high-dimensional space preset with a plurality of central points to obtain a second projection point of the feature vector sample in the high-dimensional space;
the distance calculation module is used for calculating the distance between the second projection point and a plurality of preset central points in the high-dimensional space; wherein each center point corresponds to a class of rock;
the predicted central point determining module is used for determining a predicted central point which is closest to the characteristic vector sample according to the distance between the second projection point and a plurality of central points preset in the high-dimensional space;
and the adjusting module is used for adjusting the parameters of the high-dimensional space when the rock category of the predicted central point is inconsistent with the standard rock category, and taking the high-dimensional space subjected to multiple parameter adjustments as the preset rock classification space.
Optionally, the adjusting module includes:
the target center point determining submodule is used for determining a target center point corresponding to the standard rock category;
the loss value operator module is used for calculating the loss value of the second projection point and the target central point according to the formula (1);
Figure BDA0002777663070000051
(1) wherein m is the rock imageThe number of samples; x is the number ofiIs the position coordinate of the second transmission point; c. CyiThe position coordinates of the target central point are taken as the position coordinates of the target central point;
and the adjusting submodule is used for adjusting the parameters of the preset high-dimensional space according to the loss value.
A third aspect of embodiments of the present application provides a readable storage medium, on which a computer program is stored, which, when executed by a processor, implements the steps in the method according to the first aspect of the present application.
A fourth aspect of the embodiments of the present application provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, where the processor executes the computer program to implement the steps of the method according to the first aspect of the present application.
The rock identification method and the rock identification system have the advantages that the convenient website is used as a tool to identify rocks, the rock identification model is integrated into the server of the rock identification website system, pictures of rocks to be identified are collected in real time in the field through the portable terminal, the rock identification model of the server is directly called through the application program interface of the terminal, the pictures of the rocks to be identified, which are collected in real time, are identified, the rock categories to which the rocks to be identified belong are rapidly output, errors caused by judgment of the rock categories by subjective factors of users are eliminated, and a way is provided for rapid and accurate identification of rock categories by rock enthusiasts in the field.
The embodiment of the application sets up the preset rock classification space, and carries out central constraint to the feature of the feature vector through the preset rock classification space, so that the feature used for expressing the category to which the feature vector belongs is strengthened, the classifier is further ensured to be capable of calculating based on the strengthened feature, the problem that the difference of the fine categories of the rock is small is finally overcome, and the subclasses to which the rock to be identified belongs are output.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings needed to be used in the description of the embodiments of the present application will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art that other drawings can be obtained according to these drawings without inventive exercise.
Fig. 1 is a flowchart illustrating steps of a rock recognition method according to an embodiment of the present disclosure;
FIG. 2 is an exemplary diagram of a predetermined rock classification space proposed by an embodiment of the present application;
FIG. 3 is a flowchart illustrating steps of determining a rock class to which a feature vector belongs according to an embodiment of the present disclosure;
FIG. 4 is a flowchart of identifying a picture of a rock to be identified by constructing a rock identification model according to an embodiment of the present application;
fig. 5 is a schematic structural diagram of a rock recognition device according to an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are some, but not all, embodiments of the present application. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
There are three major classes of rocks in nature: magma, sedimentary and metamorphic rock enthusiasts. However, each major rock may be subdivided to obtain a minor classification. Common rock slurries include: granite, tuff, andesite, olivine, syenite, rhyolite, syenite, basalt, rough rock, granite porphyry, and the like. Common sedimentary rocks include small groups of mudstones, limestone, coal, dolomite, sandstone, siltstone, conglomerate, silicalite, breccia, shale, and the like. Common metamorphic rocks include small categories of marble, phyllite, marble, slate, schist, gneiss, quartzite, skarn, clastic, mylonite, serpentine, hornrock, bedrock, and the like.
Under the conditions that the colors, mineral components and structural structures of various rock subclasses are different, the field time is urgent and the exposure of rock characteristics is less, the rock subclasses are difficult to accurately judge by manpower subjectively, the rock classes can only be roughly judged, and the difficulty is brought to the field rock identification.
For example, a rock lover finds a rock a located on a cliff, subjectively judges that the rock a may be granite in a rock pulp through manually recognizing partial appearance and color of the rock, and a situation of a subjective judgment error may occur due to cognitive limitations of the rock lover on the rock.
According to the rock identification method provided by the embodiment of the application, the picture of the rock A can be acquired through the terminal and uploaded to the rock identification website system, the rock type of the rock A is directly identified to be granite spanishment rock through the rock identification model, and errors caused by artificial identification subjective factors are eliminated.
In view of the above problems, the embodiments of the present application provide a rock recognition method, which is applied to a rock recognition system and can quickly recognize a rock subclass. Fig. 1 is a flowchart illustrating steps of a rock recognition method according to an embodiment of the present application, and with reference to fig. 1:
the rock recognition website system comprises a client and a server, wherein the server stores a rock recognition model provided by the embodiment of the Application, the server integrates all modules in the rock recognition system provided by the embodiment of the Application, the client is an Application program of a terminal, when receiving a corresponding instruction, the Application program (the client) is connected with the server through an Application Programming Interface (API), and the rock recognition model is operated through the corresponding modules (all modules of the rock recognition system integrated in the server) to execute the following steps in the rock recognition method provided by the embodiment of the Application.
The terminal can be a computer, a mobile phone or a tablet computer and the like. The user can upload the picture of the rock to be identified through a website interface of the terminal and initiate the triggering operation of the rock identification service.
Step S11: extracting the features of the image of the rock to be identified to obtain a feature vector;
in the deep neural network, a convolution operation may be performed on an image to extract a feature vector (feature vector) of the image as an image feature of the image.
The image of the rock to be identified may refer to a rock picture taken by a rock enthusiast in real time in the field.
Before feature extraction is carried out on the rock picture, the picture of the rock to be identified can be obtained through the terminal. Obtaining pictures of the rocks to be identified, which are uploaded to a website system;
specifically, when a user observes rocks difficult to identify in the field, the user directly uses the terminal to collect pictures of the rocks, selects the collected pictures through the application program and uploads the pictures to a server of a rock identification website system, and displays the uploaded pictures through a display interface of the application program.
The characteristic extraction of the picture uploaded to the rock recognition website system can be carried out on the picture of the rock to be recognized of the uploading system in a rock recognition interface of the website system when the trigger operation of the rock recognition service is received.
The website system may refer to a rock recognition website system.
The rock recognition service can be triggered by the application program, for example, in an interface where the application program displays a picture of the rock to be recognized, a "recognition" button is pressed, so that the application program converts the picture of the rock to be recognized, which is uploaded by a user, into a base64 coding format through an API, then inputs the picture of the base64 coding format into a rock recognition model, and performs feature extraction on the picture of the rock to be recognized by using the rock recognition model.
Under the field environment, a rock enthusiast can acquire rock pictures in real time through a portable terminal, link a server of a rock identification website system through a network, directly extract the characteristics of the rock pictures, and predict the fine classification of rocks based on the rock pictures acquired in real time. The problem of rock fan when meeting the rock that is difficult to discern in field work, can't in time discern the rock classification is solved.
Step S12: judging the rock category to which the feature vector belongs by using a preset rock classification space to obtain an intermediate classification feature vector;
and the preset rock classification space is used for carrying out central point constraint on the feature vector, constraining the features of the feature vector, and judging the subclass to which the rock belongs through the rock classification space, so that the features shown by the feature vector are closer to the features of the subclass to which the rock to be identified belongs.
Another embodiment of the present application provides a method for determining a rock class to which a feature vector belongs. Fig. 2 is an exemplary diagram of a preset rock classification space according to an embodiment of the present application, and fig. 3 is a flowchart of steps of determining a rock class to which a feature vector belongs according to an embodiment of the present application, with reference to fig. 2 and fig. 3.
Step S12-1, mapping the feature vector to the preset rock classification space to obtain a first projection point of the feature vector in the preset rock classification space; the first projection point is a transmission point of the feature vector in a preset rock classification space when the rock image is identified by applying a rock identification model. And the position of the first transmission point is calculated by a preset rock classification space according to the characteristics of the characteristic vector.
Step S12-2: calculating the distance between the first projection point and a plurality of preset central points in the preset rock classification space; wherein each center point corresponds to a class of rock;
n central points are preset in a preset rock classification space according to the number of the rock subclasses. Assuming that there are 40 kinds of rock subclasses (subclassification), 40 central points, which are a granite central point, a tuff central point, an andesite central point, an olivine central point, an orthobarite central point, a rhyolite central point, an orthobarite central point, a basalt central point, a rough face rock central point, a granite central point, an andesite central point, a pyroxene central point, a spanite central point, a spangle central point, a porphyrite central point, a dolomite central point, a sandstone central point, a siltstone central point, a conglomerate central point, a silicalite central point, a conglomerate central point, a shale central point, a marble central point, a phyllite central point, a marlite central point, a slate central point, a rough face central point, a granite central point, a limestone central point, a rock core, a, Schist center, quartzite center, skarn center, fragmentation center, mylonite center, serpentine center, hornstone center, bedrock center.
Step S12-3: determining a target central point closest to the characteristic vector according to the distance between the first projection point and a plurality of central points preset in the preset rock classification space;
the feature of the target center point closest to the feature vector, i.e. the target center point closest to the first projection point, is closest to the feature of the feature vector.
Step S12-4: and judging the rock category to which the feature vector belongs according to the rock category of the target central point.
The intermediate classification feature vector is a feature vector obtained by enhancing the features representing the rock classes in the feature vector.
Exemplarily, extracting the characteristics of the rock picture A to obtain a characteristic vector A, mapping the characteristic vector A into the preset rock classification space to obtain a first projection point A, calculating to obtain that the first projection point A is closest to the central point of the amphiphanite, so that the characteristic vector A is closest to the central point of the amphiphanite, namely, the characteristics of the amphiphanite are used for judging the characteristic vector A, and the characteristics of the characteristic vector A are strengthened by the characteristics of the amphiphanite.
Each major class of rock has a lot of fine categories, and the difference between the fine categories is not outstanding, for example, it is that granite and granite under the rock pulp rock major class (rough classification) are less, in order to make the classifier can carry out fine category to the rock more accurately, this application embodiment has set up predetermined rock classification space, carry out central constraint to the characteristic of eigenvector through predetermined rock classification space, make the vector that is used for expressing the same characteristic in the eigenvector gather more, and then guarantee that the classifier can calculate based on the outstanding characteristic after strengthening, the fine category of the rock of waiting to discern is finally exported.
Step S13: and calculating the probability of the rock to be identified belonging to different rock classes according to the intermediate classification feature vector to obtain a probability distribution vector.
The classifier can be used to calculate the probability that the rock to be identified belongs to different rock classes. Such as deep convolutional neural networks (VGGNet), deep residual networks (ResNet), or convolution-related networks built based on the inclusion architecture.
The probability distribution vector may be a multi-dimensional normalized vector.
Taking the Inception V3 algorithm architecture as an example, after the feature vector is subjected to center constraint through a preset rock classification space, the probability that the rock to be identified belongs to each subclass is predicted. Continuing with the foregoing example, there are 40 rock subclasses (fine classes), and then a 40-dimensional normalized vector is output, with the value of each dimension representing the probability that the rock to be identified belongs to a certain rock class.
Step S14: and at least outputting the probability that the rock to be identified belongs to a class of rock categories or the superior class of the rock categories to which the rock to be identified belongs according to the probability distribution vector.
Specifically, when the probability of any rock category is greater than a first preset threshold value, outputting the probability that the rock to be identified belongs to the any rock category; when the probabilities of all rock categories are smaller than a first preset threshold value, acquiring a plurality of rock categories of which the probabilities are larger than a second preset threshold value; and when the plurality of rock types belong to the upper level type of the same rock type, outputting the upper level type of the same rock type.
The first preset threshold and the second preset threshold may be set according to empirical values of the rock classification task.
Assume that the output probability distribution vector is a 13-dimensional normalized vector: the fine classification task of the rock is realized by (1%) 2% of marble, 3% of phyllite, 5% of marble, 3% of slate, 4% of schist, 65% of schist, 10% of quartzite, 1.5% of skarn, 1.5% of fragmentation rock, 1% of ground ridge, 1% of serpentine, 2% of hornrock and 1% of banlangite, wherein the first preset threshold is 50%, the probability of schist is 65% higher than the first preset threshold, the probability of schist output schist is 65%, and the fine classification task of the rock is realized. When there are multiple fine categories greater than the first preset threshold, the system may output multiple rock categories "subclasses," and display the multiple rock categories and the corresponding probabilities for each rock category on a display interface of the application.
And when the rock recognition model cannot judge the subdivision class of the rock to be recognized, judging the large class of the rock to be recognized, namely the superior class of the rock to be recognized according to the distribution of different rock probabilities. For example, magma is a top category of granite and tuff.
Assume that the output probability distribution vector is a 23-dimensional normalized vector: [ marble-2%, phyllite-13%, marble-10%, slate-13.5%, schist-10%, gneiss-10%, quartzite-10%, skarn-10%, fragmentation-1.5%, ground ridge-1%, serpentine-1%, hornrock-2%, green rock-1%, mudstone-1.5%, limestone-1.5%, coal-1.5%, dolomite-1.5%, sandstone-1.5%, siltstone-1.5%, conglomerate-1.5%, silicalite-1.5%, breccia-1.5%, shale-1.5%, and a second predetermined threshold of 50% and 8%, so that no rock category belongs to the rock to be identified, and further 7 rock categories greater than the second predetermined threshold are determined, and if the upper category of the 7 rock categories is sedimentary rock, outputting the sedimentary rock.
According to the rock classification method and device, the calculation result of the rock identification model is divided by setting the first preset threshold and the second preset threshold, when the subdivision of the rock can be judged, the subdivision and the probability corresponding to the subdivision are output for the user to refer to, and when the subdivision cannot be judged, the large class to which the rock to be classified accurately belongs can be output based on the judgment result of the subdivision.
The rock identification method and the rock identification device have the advantages that the convenient website is used as a tool to identify rocks, the rock identification model is integrated into the server of the rock identification website, when the terminal collects pictures of rocks to be identified in the field in real time, the application program interface of the terminal is directly used to call the rock identification model of the server, the pictures of the rocks to be identified collected in real time are identified, the rock categories to which the rocks to be identified belong are rapidly output, errors caused by subjective judgment of a user on the rock categories are eliminated, and a way is provided for rock enthusiasts to rapidly and accurately identify the rock categories in the field.
In order to more intelligently implement the method proposed by the applicant and enable the application range of the method to be wider, the applicant firstly constructs a neural network model to be trained, so as to train a sample training neural network model to obtain a rock recognition model.
Firstly, different types of rock image data are shot from the field or downloaded from the internet, and the rock types (fine categories) corresponding to each picture are marked by professionals.
And secondly, carrying out data enhancement on the labeled rock image data to enhance the diversity of model training data. For example, data enhancement on a color space is performed on rock image data to obtain a plurality of rock image data matched with different color spaces; wherein the single color space matches at least one rock image data to obtain rock image data under different light conditions. Or randomly cutting and turning the rock image data.
And dividing the rock image data into a training set and a verification set.
The neural network model constructed by training with the training set, for example, the neural network model constructed by the inclusion V3 algorithm. And updating the parameters of the neural network model by adopting an Adam gradient descent algorithm until the identification accuracy of the neural network model reaches a preset accuracy, and obtaining a final rock identification model.
And further using Django as a website back-end framework to develop a website system (server) capable of uploading rock pictures.
When the rock recognition model is used, the trained neural network parameters are converted into binary files, the binary files are stored in a rock recognition server, and the tensoflow serving technology is used for providing API service for rock recognition.
In order to enable the rock recognition model to have the function of strengthening the characteristics of the rock to be recognized, the high-dimensional space set in the neural network model is trained by adopting a central constraint loss function, so that the high-dimensional space can accurately map the projection point of the feature vector in the high-dimensional space to the vicinity of the central point of the category to which the rock to be recognized belongs, and the purpose of carrying out central constraint on the feature vector by the category to which the rock to be recognized belongs is achieved.
The method for obtaining the preset rock classification space through training comprises the following steps:
firstly, marking standard rock types on the obtained rock images to obtain rock image samples; performing feature extraction on the rock image sample to obtain a feature vector sample; inputting the feature vector sample into a high-dimensional space preset with a plurality of central points to obtain a second projection point of the feature vector sample in the high-dimensional space;
the rock image is a rock picture acquired in advance, and only one rock is displayed on the picture.
The second projection point is a projection point of the feature vector in the high-dimensional space when the high-dimensional space is trained.
The dimensionality of the high-dimensionality space can be set according to the application range of the rock recognition model. Taking the probability that whether the rock to be identified belongs to 40 rock categories or not, which needs to be analyzed in the embodiment of the application, and outputting a normalized vector of 40 dimensions as an example, the dimension of the high-dimensional space is set to be 40.
And setting a central point in each dimension space, after the characteristic vectors are mapped to the high-dimension space, projecting the class characteristics corresponding to the central point in the range of the points, wherein the class characteristics are the same as the rock class corresponding to the characteristic vectors, namely the high-dimension space clusters the characteristic vectors corresponding to the same class of rocks.
In the initial stage of training, the accuracy of clustering the feature vectors corresponding to the same rock class by the high-dimensional space mapping feature vector pair is not high, a central constraint loss function is set, and high-dimensional space parameters are adjusted, so that the feature vectors are accurately clustered by the high-dimensional space.
In training, calculating the distance between the second projection point and a plurality of central points preset in the high-dimensional space; wherein each center point corresponds to a class of rock; determining a prediction central point closest to the characteristic vector sample according to the distance between the second projection point and a plurality of central points preset in the high-dimensional space; and when the rock category of the predicted central point is inconsistent with the standard rock category, adjusting the parameters of the high-dimensional space, and taking the high-dimensional space subjected to multiple parameter adjustments as the preset rock classification space.
When the rock category of the predicted center point is inconsistent with the standard rock category, the position of a target center point corresponding to the standard rock category in a high latitude space is determined, the gradient is calculated according to the position of the target center point in the high latitude space, the parameter of the high latitude space and the position of a preset center point in the high latitude space are adjusted, so that when the high latitude space aims at the images of the same type of rocks to be identified, the feature vectors of the images of the same type of rocks to be identified can be mapped into the range of the target center point, and the fine rock categories expressed by the feature vectors can be accurately determined according to the feature vectors after multiple times of training, so that the feature vectors are more aggregated in the high dimension space by the fine rock categories, and the features of the fine rock categories are highlighted.
Specifically, determining a target central point corresponding to the standard rock category; calculating the loss value of the second projection point and the target central point according to the formula (1);
Figure BDA0002777663070000131
center Loss refers to a Center constrained Loss function.
(1) Wherein m is the number of rock image samples; x is the number ofiThe position coordinates of the second projection point are obtained; c. CyiThe position coordinates of the target central point are taken as the position coordinates of the target central point; and i is a rock image sample currently processed, so that the value range of i is (1, m), and y is a mark number of a central point corresponding to the target central point. Assuming that 4 central points are preset in the high latitude space, which are respectively a 1# -mudstone central point, a 2# -limestone central point, a 3# -coal central point and a 4# -dolomite central point,then when the standard rock category marked in the rock image sample is limestone, the target central point is the limestone central point, and y is 2 #.
The position coordinates of the second projection point and the position coordinates of the target center point are obtained by a coordinate system established based on a high latitude space.
And adjusting the parameters of the preset high-dimensional space according to the loss value.
Fig. 4 is a flowchart for constructing a rock recognition model to recognize a picture of a rock to be recognized according to an embodiment of the present application.
1. Rock data is collected and a training data set is established.
2. And (5) building a neural network model.
3. And training the neural network model by using the data set to obtain a rock recognition model.
4. And storing the parameters of the rock recognition model in a binary mode, and uploading the parameters to a server to provide interface service. .
5. Django is adopted as a website backend framework.
6. And establishing a server of the rock recognition website.
7. And uploading the acquired picture of the rock to be identified to a server of the rock identification website system by the user.
8. And remotely calling the rock recognition model to recognize the picture of the rock to be recognized to obtain the recognized rock subdivision classification result.
Based on the same inventive concept, the embodiment of the application provides a rock recognition device. Referring to fig. 5, fig. 5 is a schematic structural diagram of a rock recognition device according to an embodiment of the present application. The device includes:
the first identification module 51 is configured to perform feature extraction on a picture of a rock to be identified to obtain a feature vector;
the judging module 52 is configured to judge the rock category to which the feature vector belongs by using a preset rock classification space, so as to obtain an intermediate classification feature vector;
the calculating module 53 is configured to calculate, according to the intermediate classification feature vector, probabilities that the rocks to be identified belong to different rock categories, so as to obtain probability distribution vectors;
and the output module 54 is configured to output at least the probability that the rock to be identified belongs to one rock category or the superior category of the rock category to which the rock to be identified belongs according to the probability distribution vector.
Optionally, the apparatus further comprises:
the acquisition module is used for acquiring the pictures of the rocks to be identified, which are uploaded to the website system;
the first identification module comprises:
and the recognition submodule is used for performing feature extraction on the picture of the rock to be recognized when the triggering operation of the rock recognition service is received in the rock recognition interface of the website system.
Optionally, the output module includes:
the first output submodule is used for outputting the probability that the rock to be identified belongs to any rock category when the probability of the rock category is larger than a first preset threshold value;
the obtaining submodule is used for obtaining a plurality of rock categories of which the probability is greater than a second preset threshold when the probabilities of all the rock categories are smaller than the first preset threshold;
and the second output submodule is used for outputting the superior class of the same rock class when the plurality of rock classes belong to the superior class of the same rock class.
Optionally, the determining module includes:
the mapping submodule is used for mapping the feature vector to the preset rock classification space to obtain a first projection point of the feature vector in the preset rock classification space;
the calculation submodule is used for calculating the distances between the first projection point and a plurality of preset central points in the preset rock classification space; wherein each center point corresponds to a class of rock;
the distance determining submodule is used for determining a target central point closest to the characteristic vector according to the distance between the first projection point and a plurality of preset central points in the preset rock classification space;
and the judging submodule is used for judging the rock category to which the feature vector belongs according to the rock category of the target central point.
Optionally, the apparatus further comprises:
the marking module is used for marking the standard rock types of the obtained rock images to obtain rock image samples;
the second identification module is used for extracting the characteristics of the rock image sample to obtain a characteristic vector sample;
the input module is used for inputting the feature vector sample into a high-dimensional space preset with a plurality of central points to obtain a second projection point of the feature vector sample in the high-dimensional space;
the distance calculation module is used for calculating the distance between the second projection point and a plurality of preset central points in the high-dimensional space; wherein each center point corresponds to a class of rock;
the predicted central point determining module is used for determining a predicted central point which is closest to the characteristic vector sample according to the distance between the second projection point and a plurality of central points preset in the high-dimensional space;
and the adjusting module is used for adjusting the parameters of the high-dimensional space when the rock category of the predicted central point is inconsistent with the standard rock category, and taking the high-dimensional space subjected to multiple parameter adjustments as the preset rock classification space.
Optionally, the adjusting module includes:
the target center point determining submodule is used for determining a target center point corresponding to the standard rock category;
the loss value operator module is used for calculating the loss value of the second projection point and the target central point according to the formula (1);
Figure BDA0002777663070000161
(1) in the formula, m isThe number of rock image samples; x is the number ofiIs the position coordinate of the second transmission point; c. CyiThe position coordinates of the target central point are taken as the position coordinates of the target central point;
and the adjusting submodule is used for adjusting the parameters of the preset high-dimensional space according to the loss value.
Based on the same inventive concept, another embodiment of the present application provides a readable storage medium, on which a computer program is stored, which when executed by a processor implements the steps in the rock recognition method according to any of the above embodiments of the present application.
Based on the same inventive concept, another embodiment of the present application provides an electronic device, which includes a memory, a processor, and a computer program stored on the memory and executable on the processor, and when the processor executes the computer program, the method of identifying a rock according to any of the above embodiments of the present application is implemented.
For the device embodiment, since it is basically similar to the method embodiment, the description is simple, and for the relevant points, refer to the partial description of the method embodiment.
The embodiments in the present specification are described in a progressive or descriptive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other.
As will be appreciated by one of skill in the art, embodiments of the present application may be provided as a method, apparatus, or computer program product. Accordingly, embodiments of the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, embodiments of the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
Embodiments of the present application are described with reference to flowchart illustrations and/or block diagrams of methods, apparatus, and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing terminal to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing terminal, create a system for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing terminal to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including an instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing terminal to cause a series of operational steps to be performed on the computer or other programmable terminal to produce a computer implemented process such that the instructions which execute on the computer or other programmable terminal provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
While preferred embodiments of the present application have been described, additional variations and modifications of these embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. Therefore, it is intended that the appended claims be interpreted as including the preferred embodiment and all such alterations and modifications as fall within the true scope of the embodiments of the application.
Finally, it should also be noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or terminal 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, method, article, or terminal. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or terminal that comprises the element.
The rock identification method, the rock identification device, the rock identification equipment and the storage medium provided by the application are described in detail, and the description of the embodiment is only used for helping to understand the method and the core idea of the application; meanwhile, for a person skilled in the art, according to the idea of the present application, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present application.

Claims (9)

1. A method of rock identification, the method comprising:
extracting the features of the image of the rock to be identified to obtain a feature vector;
judging the rock category to which the feature vector belongs by using a preset rock classification space to obtain an intermediate classification feature vector; the preset rock classification space is used for carrying out central point constraint on the feature vectors; wherein, different central points correspond to different fine categories of the rock;
calculating the probability that the rocks to be identified belong to different rock categories according to the intermediate classification feature vector to obtain a probability distribution vector;
according to the probability distribution vector, at least outputting the probability that the rock to be identified belongs to a class of rock or the superior class of the class of rock to which the rock to be identified belongs;
wherein:
utilizing a preset rock classification space to judge the rock class to which the feature vector belongs, wherein the judgment comprises the following steps:
mapping the feature vector to the preset rock classification space to obtain a first projection point of the feature vector in the preset rock classification space;
calculating the distance between the first projection point and a plurality of preset central points in the preset rock classification space; wherein each center point corresponds to a class of rock;
determining a target central point closest to the characteristic vector according to the distance between the first projection point and a plurality of central points preset in the preset rock classification space;
and judging the rock category to which the feature vector belongs according to the rock category of the target central point.
2. The method of claim 1, further comprising:
obtaining pictures of the rocks to be identified, which are uploaded to a website system;
the characteristic extraction is carried out on the picture of the rock to be identified, and the characteristic extraction comprises the following steps:
and in the rock identification interface of the website system, when the trigger operation of the rock identification service is received, extracting the characteristics of the picture of the rock to be identified.
3. The method according to claim 1, wherein outputting at least the probability that the rock to be identified belongs to a class of rock categories or the superior class of rock categories to which the rock to be identified belongs according to the probability distribution vector comprises:
when the probability of any rock category is larger than a first preset threshold value, outputting the probability that the rock to be identified belongs to the any rock category;
when the probabilities of all rock categories are smaller than a first preset threshold value, acquiring a plurality of rock categories of which the probabilities are larger than a second preset threshold value;
and when the plurality of rock types belong to the upper level type of the same rock type, outputting the upper level type of the same rock type.
4. The method of claim 1, further comprising:
marking the obtained rock image with a standard rock category to obtain a rock image sample;
performing feature extraction on the rock image sample to obtain a feature vector sample;
inputting the feature vector sample into a high-dimensional space preset with a plurality of central points to obtain a second projection point of the feature vector sample in the high-dimensional space;
calculating the distance between the second projection point and a plurality of preset central points in the high-dimensional space; wherein each center point corresponds to a class of rock;
determining a prediction central point closest to the characteristic vector sample according to the distance between the second projection point and a plurality of central points preset in the high-dimensional space;
and when the rock category of the predicted central point is inconsistent with the standard rock category, adjusting the parameters of the high-dimensional space, and taking the high-dimensional space subjected to multiple parameter adjustments as the preset rock classification space.
5. The method of claim 4, wherein adjusting the parameters of the high dimensional space comprises:
determining a target central point corresponding to the standard rock category;
calculating the loss value of the second projection point and the target central point according to the formula (1);
Figure FDA0003307782500000021
(1) wherein m is the number of rock image samples; x is the number ofiThe position coordinates of the second projection point are obtained; c. CyiThe position coordinates of the target central point are taken as the position coordinates of the target central point;
and adjusting the parameters of the preset high-dimensional space according to the loss value.
6. A rock recognition apparatus, characterized in that the apparatus comprises:
the first identification module is used for extracting the characteristics of the image of the rock to be identified to obtain a characteristic vector;
the judging module is used for judging the rock category to which the feature vector belongs by utilizing a preset rock classification space to obtain an intermediate classification feature vector; the preset rock classification space is used for carrying out central point constraint on the characteristic vectors, and different central points correspond to different fine classifications of rocks;
the calculation module is used for calculating the probability that the rock to be identified belongs to different rock categories according to the intermediate classification feature vector to obtain a probability distribution vector;
the output module is used for at least outputting the probability that the rock to be identified belongs to one rock class or the superior class of the rock class to which the rock to be identified belongs according to the probability distribution vector;
utilizing a preset rock classification space to judge the rock class to which the feature vector belongs, wherein the judgment comprises the following steps:
mapping the feature vector to the preset rock classification space to obtain a first projection point of the feature vector in the preset rock classification space;
calculating the distance between the first projection point and a plurality of preset central points in the preset rock classification space; wherein each center point corresponds to a class of rock;
determining a target central point closest to the characteristic vector according to the distance between the first projection point and a plurality of central points preset in the preset rock classification space;
and judging the rock category to which the feature vector belongs according to the rock category of the target central point.
7. The apparatus of claim 6, further comprising:
the acquisition module is used for acquiring the pictures of the rocks to be identified, which are uploaded to the website system;
the first identification module comprises:
and the recognition submodule is used for performing feature extraction on the picture of the rock to be recognized when the triggering operation of the rock recognition service is received in the rock recognition interface of the website system.
8. A readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the steps of the method according to any one of claims 1 to 5.
9. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor when executed implements the steps of the method according to any of claims 1-5.
CN202011270883.XA 2020-11-13 2020-11-13 Rock recognition method, device, equipment and storage medium Active CN112348100B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011270883.XA CN112348100B (en) 2020-11-13 2020-11-13 Rock recognition method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011270883.XA CN112348100B (en) 2020-11-13 2020-11-13 Rock recognition method, device, equipment and storage medium

Publications (2)

Publication Number Publication Date
CN112348100A CN112348100A (en) 2021-02-09
CN112348100B true CN112348100B (en) 2021-12-17

Family

ID=74363685

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011270883.XA Active CN112348100B (en) 2020-11-13 2020-11-13 Rock recognition method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN112348100B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112801205B (en) * 2021-02-20 2022-04-15 中国科学院地质与地球物理研究所 Method and device for acquiring rock pattern layer structure
CN113159112B (en) * 2021-03-09 2023-04-07 西南石油大学 Automatic labeling method for ancient biological fossil image
CN113537380A (en) * 2021-07-29 2021-10-22 北京数美时代科技有限公司 Pornographic image identification method, pornographic image identification system, storage medium and electronic equipment
CN113670859B (en) * 2021-09-24 2023-11-17 湖北省地震局(中国地震局地震研究所) Imaging contrast identification system and method for rapidly identifying rocks in field

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
NO2310880T3 (en) * 2008-08-06 2017-12-30
CN103699889A (en) * 2014-01-06 2014-04-02 成都理工大学 Hyperspectral remote sensing technology-based tailings identifying method and system
CN109388816A (en) * 2017-08-07 2019-02-26 中国石油化工股份有限公司 A kind of hierarchical identification method of complex lithology
CN108197630A (en) * 2018-03-19 2018-06-22 中国矿业大学(北京) A kind of Coal-rock identification method based on self study
CN108596163A (en) * 2018-07-10 2018-09-28 中国矿业大学(北京) A kind of Coal-rock identification method based on CNN and VLAD
CN110232419A (en) * 2019-06-20 2019-09-13 东北大学 A kind of method of side slope rock category automatic identification
CN110610165A (en) * 2019-09-18 2019-12-24 上海海事大学 Ship behavior analysis method based on YOLO model

Also Published As

Publication number Publication date
CN112348100A (en) 2021-02-09

Similar Documents

Publication Publication Date Title
CN112348100B (en) Rock recognition method, device, equipment and storage medium
CN108121984B (en) Character recognition method and device
CN105283902B (en) The storage medium of image processing apparatus, image processing method and image processing program
CN109902833B (en) Machine learning model interpretation method and device
CN109977765A (en) Facial image recognition method, device and computer equipment
CN111178120B (en) Pest image detection method based on crop identification cascading technology
JP6572269B2 (en) Learning device, learning method, and program
CN110399763B (en) Face recognition method and system
CN103474065A (en) Method for determining and recognizing voice intentions based on automatic classification technology
CN104063686B (en) Crop leaf diseases image interactive diagnostic system and method
CN109271533A (en) A kind of multimedia document retrieval method
CN107038462B (en) Equipment control operation method and system
CN111626371A (en) Image classification method, device and equipment and readable storage medium
CN109657539B (en) Face value evaluation method and device, readable storage medium and electronic equipment
CN115713715B (en) Human behavior recognition method and recognition system based on deep learning
CN107077510A (en) A kind of information output method and device
CN107766868A (en) A kind of classifier training method and device
CN111861488A (en) Machine learning model comparison method and device
CN111695824A (en) Risk tail end client analysis method, device, equipment and computer storage medium
CN111784665A (en) OCT image quality assessment method, system and device based on Fourier transform
CN115393606A (en) Method and system for image recognition
CN112417918B (en) Two-dimensional code identification method and device, storage medium and electronic equipment
CN110969240B (en) Pruning method, device, equipment and medium for deep convolutional neural network
CN111414951B (en) Fine classification method and device for images
CN111144902A (en) Questionnaire data processing method and device, storage medium and electronic equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant