Friday, October 2, 2026
Science
No Result
View All Result
  • Login
  • HOME
  • SCIENCE NEWS
  • CONTACT US
  • HOME
  • SCIENCE NEWS
  • CONTACT US
No Result
View All Result
Scienmag
No Result
View All Result
Home Science News Technology and Engineering

AI Learns to Match Rock Scans With Near-Perfect Accuracy Using N-Pair Loss

October 2, 2026
in Technology and Engineering
Blake Davidson
By Blake Davidson Scienmag Editorial Profile - Data Science
Reading Time: 5 mins read
0
AI Learns to Match Rock Scans With Near-Perfect Accuracy Using N-Pair Loss

AI Learns to Match Rock Scans With Near-Perfect Accuracy Using N-Pair Loss

AI Learns to Match Rock Scans With Near-Perfect Accuracy Using N-Pair Loss

65
SHARES
587
VIEWS
Share on FacebookShare on Twitter
ADVERTISEMENT

Deep beneath the ocean floor off the coast of Brazil, the pre-salt reservoirs hold some of the most valuable oil and gas deposits ever discovered. Understanding the rocks that host these resources requires an intimate knowledge of their internal architecture, and that knowledge increasingly comes from X-ray tomography, which produces thousands of grayscale slices revealing pore networks, mineral grains and textural patterns in exquisite detail. Now, a team of Brazilian researchers has shown that a deep learning technique called N-pair loss can search through these tomographic archives with near-perfect accuracy, retrieving images of structurally similar rock samples and potentially transforming how geologists and petroleum engineers explore digital rock collections.

The study, published in Multimedia Tools and Applications by researchers at the Federal University of Maranhão and the Pontifical Catholic University of Rio de Janeiro, tackles a problem that has long frustrated automated analysis of geological imagery. Content-based image retrieval, or CBIR, allows computers to find images that look similar to a query image without relying on text labels. The approach has proven its worth in face recognition, e-commerce and medical imaging, but rock tomography presents a uniquely hostile environment for such systems. Slices from different rock samples can look strikingly alike, while subtle variations in pore connectivity and grain texture separate samples that matter enormously for fluid flow predictions. A retrieval system that cannot distinguish these fine differences is worse than useless, because it returns plausible-looking but geologically irrelevant results.

The researchers’ solution draws on deep metric learning, a family of techniques that trains neural networks not simply to classify images but to arrange them in a mathematical space where distance equals meaning. In such an embedding space, slices from the same rock volume cluster tightly together while slices from different volumes are pushed far apart. When a user submits a query slice, the system encodes it into this space and returns the nearest neighbors by Euclidean distance. The critical question is how to train the network to build this well-organized space, and this is where the choice of loss function becomes decisive.

Earlier metric learning approaches relied on contrastive loss, which compares pairs of images, or triplet loss, which compares an anchor image against one positive example and one negative example simultaneously. Both formulations suffer from a well-known weakness: they are highly sensitive to which samples happen to appear in each training batch, and they require careful mining of difficult negative examples to work well. N-pair loss, introduced by Google researcher Kihyuk Sohn in 2016, takes a different tack. Instead of contrasting an anchor against a single negative, it pits the anchor-positive pair against multiple negatives at once, using a softmax-like exponential formulation. Each training step therefore delivers a far richer gradient signal, encouraging compact clusters and clear separation between classes without the instability that plagues simpler pairwise methods.

To test whether this multi-negative strategy could handle the subtleties of rock imagery, the team trained models on two publicly available datasets from the Digital Rocks Portal. The first, the 16 Brazilian Pre-Salt Carbonates dataset, contains micro-CT volumes of carbonate rock from the pre-salt formations, captured at voxel resolutions ranging from 6 to 64 micrometers. The second, the 11 Sandstones dataset, includes 1000 slices from each of eleven sandstone varieties, from Bandera Gray to Bentheimer. The researchers preprocessed the volumes into 128-by-128-pixel slices and, crucially, split each volume sequentially along its slicing axis, reserving the first half of every volume for training and the second half for testing. This conservative design prevents the near-identical adjacent slices that characterize tomographic data from leaking between training and evaluation, a pitfall that could artificially inflate performance.

The architecture itself combined well-known convolutional backbones, including EfficientNetB0, EfficientNetV2M, ResNet101, DenseNet201 and MobileNet, all pretrained on ImageNet, with an embedding layer that projects extracted features into a lower-dimensional latent space. The team varied the number of negative samples from two to five and the embedding dimensionality from 16 upward, running each configuration three times to report mean and standard deviation. The results were striking. On the carbonate dataset, a DenseNet201 model with five negative pairs and a 16-dimensional embedding achieved an F1-score of 98.87 plus or minus 1.17 percent and a mean average precision of 98.83 plus or minus 1.22 percent. On the sandstone dataset, an EfficientNetB0 configuration pushed even higher, reaching 99.71 percent F1-score and 99.64 percent mAP, meaning that nearly every retrieved slice genuinely belonged to the same rock volume as the query.

Perhaps the most interesting finding is that no single backbone dominated across both materials. The deep, hierarchical architectures of ResNet101 and DenseNet201 excelled on the heterogeneous, irregularly porous carbonates, while the lighter EfficientNetB0, with its balanced scaling of depth, width and resolution, proved most stable on the more uniform, grain-dominated sandstones. The researchers attribute this to the alignment between each architecture’s inductive biases and the visual character of the material. DenseNet201, which emphasizes fine textural continuity through its densely connected feature reuse, actually became unstable on sandstones, where discrimination depends more on subtle global structural differences than on local texture. The lesson for practitioners is that backbone selection should follow the geology, not the leaderboard.

The team also demonstrated that the gains were not an artifact of their training setup. Compared against a triplet loss model previously published for rock tomography retrieval, a double Siamese network that incorporates porosity and permeability data, and a conventional classification-based retrieval baseline, the N-pair loss approach outperformed all of them on both datasets. On the sandstones, it beat the DSNN approach by roughly seven percentage points of F1-score, even though that competitor had access to extra physical metadata. An ablation study confirmed that adding L2 regularization to the loss, which penalizes overly large feature vector magnitudes, was essential: without it, carbonate performance dropped by more than five percentage points, suggesting that constraining embedding geometry promotes genuine generalization rather than memorization.

Most compelling of all were the cross-dataset experiments, in which models trained exclusively on sandstones were tested on carbonates and vice versa. Performance inevitably fell, to roughly 77 to 80 percent F1-score, but the fact that the models retained any meaningful retrieval ability across such radically different lithologies indicates that the learned embeddings encode transferable structural and textural descriptors rather than dataset-specific shortcuts. The researchers note that if the near-perfect intra-dataset scores had merely reflected the controlled nature of the tomography data, a far larger collapse would have been expected under this severe distribution shift. Instead, the models appear to have captured general morphological features of porous media.

The practical implications extend well beyond academic benchmarks. In oil and gas exploration, identifying and categorizing rock formations directly shapes resource management and extraction decisions, and a retrieval system that instantly surfaces structurally similar samples from vast tomographic archives could accelerate comparative analysis, quality assessment and geological interpretation. The method also requires no porosity or permeability measurements, only images, making it applicable wherever non-visual metadata is scarce. Limitations remain: the validation covered only rock datasets, the training used random rather than adaptive negative sampling, and the model still confuses closely related Berea sandstone subtypes whose petrophysical properties genuinely overlap. The authors point to hard negative mining, margin-based constraints and hybrid metric-classification objectives as promising next steps. For now, though, the work establishes that multi-negative metric learning, long proven on natural image benchmarks, can master the subtle, highly correlated structures of the subsurface, bringing automated digital rock analysis a significant step closer to the drilling rig.

Subject of Research: Deep metric learning with N-pair loss for content-based retrieval of rock tomography images

Article Title: Rock tomography image retrieval: a deep metric learning approach with N-pair loss

Article References: Silva, A., Farias, M., Souza, J., Pinto, D., Belfort, F., Freitas, M., Araújo, A., Pessoa, A., Paiva, A., Silva, A., Rodrigues, A., & Albuquerque, M. (2026). Rock tomography image retrieval: a deep metric learning approach with N-pair loss. Multimedia Tools and Applications, 85(10), Article 772. https://doi.org/10.1007/s11042-026-21936-w

Image Credits: AI Generated

DOI: 10.1007/s11042-026-21936-w

Keywords: content-based image retrieval, rock tomography, N-pair loss, deep metric learning, digital rock analysis, micro-CT, pre-salt carbonates, sandstones, convolutional neural networks, embedding space, petroleum geoscience, machine learning

Cite Scienmag News

Blake Davidson. (October 2, 2026). AI Learns to Match Rock Scans With Near-Perfect Accuracy Using N-Pair Loss. Scienmag. https://scienmag.com/ai-learns-to-match-rock-scans-with-near-perfect-accuracy-using-n-pair-loss/

Blake Davidson. "AI Learns to Match Rock Scans With Near-Perfect Accuracy Using N-Pair Loss." Scienmag, 2 October 2026, https://scienmag.com/ai-learns-to-match-rock-scans-with-near-perfect-accuracy-using-n-pair-loss/. Accessed 2 October 2026.

Blake Davidson. "AI Learns to Match Rock Scans With Near-Perfect Accuracy Using N-Pair Loss." Scienmag. October 2, 2026. https://scienmag.com/ai-learns-to-match-rock-scans-with-near-perfect-accuracy-using-n-pair-loss/

Tags: AI-driven analysis of pre-salt reservoirsautomated analysis of subsurface reservoirscontent-based image retrievalcontent-based image retrieval for geosciencesconvolutional neural networksDeep learning for geological image retrievaldeep metric learningdigital rock analysisdigital rock collection explorationdigital transformation in geological studiesembedding spaceMachine learningmachine learning in oil and gas explorationmicro-CTmineral and pore network imagingN-pair lossN-pair loss in rock tomographynear-perfect accuracy in geological image matchingpetroleum geosciencepre-salt carbonatesrock tomographysandstonesstructural similarity detection in rock samplesX-ray tomography in petroleum geology
Share26Tweet16
Previous Post

Divorce Hotspots Revealed: Tanzanian Study Maps Where Marriages Fall Apart

Next Post

Satellite Radar Reveals How a Sinking Chinese City Learned to Pump Groundwater Safely Again

Related Posts

European Experts Issue New Standards for Managing Tiny Veins in Newborns
Technology and Engineering

European Experts Issue New Standards for Managing Tiny Veins in Newborns

October 2, 2026
AI Network Sharpens Detection of Dangerous Brain Aneurysms on CT Scans
Technology and Engineering

AI Network Sharpens Detection of Dangerous Brain Aneurysms on CT Scans

October 2, 2026
Wave Phase Reversal Offers a Simple, Robust Way to Measure Concrete Crack Depth
Technology and Engineering

Wave Phase Reversal Offers a Simple, Robust Way to Measure Concrete Crack Depth

October 2, 2026
AI Learns to Pick the Best Lab-Matured Embryos From Time-Lapse Footage
Technology and Engineering

AI Learns to Pick the Best Lab-Matured Embryos From Time-Lapse Footage

October 2, 2026
AI Model Tracks How Scientists Drift Between Research Fields Over Time
Technology and Engineering

AI Model Tracks How Scientists Drift Between Research Fields Over Time

October 2, 2026
pyjevsim 2.2.0 Unifies Python Simulation with Distributed HLA Backends
Technology and Engineering

pyjevsim 2.2.0 Unifies Python Simulation with Distributed HLA Backends

October 2, 2026
Next Post
Satellite Radar Reveals How a Sinking Chinese City Learned to Pump Groundwater Safely Again

Satellite Radar Reveals How a Sinking Chinese City Learned to Pump Groundwater Safely Again

  • Mothers who receive childcare support from maternal grandparents show more optimized

    Mothers who receive childcare support from maternal grandparents show more parental warmth, finds NTU Singapore study

    27656 shares
    Share 11059 Tweet 6912
  • University of Seville Breaks 120-Year-Old Mystery, Revises a Key Einstein Concept

    1061 shares
    Share 424 Tweet 265
  • Bee body mass, pathogens and local climate influence heat tolerance

    682 shares
    Share 273 Tweet 171
  • Researchers record first-ever images and data of a shark experiencing a boat strike

    546 shares
    Share 218 Tweet 137
  • Groundbreaking Clinical Trial Reveals Lubiprostone Enhances Kidney Function

    531 shares
    Share 212 Tweet 133
Science

Embark on a thrilling journey of discovery with Scienmag.com—your ultimate source for cutting-edge breakthroughs. Immerse yourself in a world where curiosity knows no limits and tomorrow’s possibilities become today’s reality!

RECENT NEWS

  • European Experts Issue New Standards for Managing Tiny Veins in Newborns
  • AI Learns to Identify Ships From Sound With Only a Handful of Examples
  • Satellite Radar Reveals How a Sinking Chinese City Learned to Pump Groundwater Safely Again
  • AI Learns to Match Rock Scans With Near-Perfect Accuracy Using N-Pair Loss

Categories

  • Agriculture
  • Anthropology
  • Archaeology
  • Athmospheric
  • Biology
  • Biotechnology
  • Blog
  • Bussines
  • Cancer
  • Chemistry
  • Climate
  • Earth Science
  • Editorial Policy
  • Marine
  • Mathematics
  • Medicine
  • Pediatry
  • Policy
  • Psychology & Psychiatry
  • Science Education
  • Social Science
  • Space
  • Technology and Engineering

Subscribe to Blog via Email

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Join 5,151 other subscribers

© 2025 Scienmag - Science Magazine

Welcome Back!

Login to your account below

Forgotten Password?

Retrieve your password

Please enter your username or email address to reset your password.

Log In
No Result
View All Result
  • HOME
  • SCIENCE NEWS
  • CONTACT US

© 2025 Scienmag - Science Magazine

Discover more from Science

Subscribe now to keep reading and get access to the full archive.

Continue reading