REVIEW 3 major objections 5 minor 36 references
Nearest neighbor permutation entropy detects phase transitions in complex high-pressure systems
T0 review · 3 major / 5 minor · reviewed 2026-08-07 · deepseek-v4-flash
Pith's one-line read The k-nearest neighbor permutation entropy of in situ near-infrared spectra, fed into an expanding-window anomaly detector, pinpoints phase-transition pressures during depressurization of CO$_2$–petroleum mixtures, matching expert labels…
desk verdict Useful method with an overstated out-of-sample claim: R2=0.96 comes from trial-level cross-validation over replicated conditions, not unseen conditions. read the letter →
The pith
A machine-rendered reading of the paper's core claim, the machinery that carries it, and where it could break.
The reading
What carries the argument
The central object is the k-nearest neighbor permutation entropy: a graph-based variant of Bandt–Pompe permutation entropy in which each (wavelength, absorbance) point of a spectrum becomes a node of a k-nearest-neighbor graph built after min–max normalizing both coordinates, and biased second-order Markov random walks over that graph generate sequences that are symbolized by sorting permutations of embedding dimension $d$. The normalized Shannon entropy of the resulting ordinal distribution is a single number in $[0,1]$ that is insensitive to amplitude rescaling yet reflects local ordering, so a phase transition shows up as an abrupt change in that number. The detection rule is the expanding-window anomaly band: as depressurization proceeds, only spectra already acquired update $\mu_P$, $\sigma_P$, and the band $\mu_P \pm \gamma\sigma_P$, which is what makes the prediction online rather than retrospective.
What would settle it
Run the identical pipeline, with parameters fixed at $k = 265$, $d = 5$, $\gamma = 2.25$ and the default random-walk settings, on NIR spectra from depressurization trials of a binary system such as CO$_2$ with a pure alkane whose saturation pressures are certified by an equation of state or a calibrated visual cell; if the out-of-sample predictions against those certified pressures fall well below $R^2 = 0.96$, or the fixed parameters fail to flag the transitions, the claimed accuracy would be tied to the expert-label convention and to this specific dataset.
Extended reading notes
Core claim
On the paper's own terms, the discovery is that the k-nearest neighbor permutation entropy of a spectrum is a sensitive indicator of phase state whose first excursion outside a running confidence band coincides with the expert-identified transition pressure in 41 of 42 depressurization trials. Each spectrum's entropy is treated as a value in a sequence indexed by falling pressure; an expanding window from the starting pressure maintains a running mean $\mu_P$ and standard deviation $\sigma_P$, and the predicted transition pressure $P_t^{\mathrm{knn}}$ is the pressure at which the entropy first leaves the band $\mu_P \pm \gamma\sigma_P$. With parameters chosen by leave-one-out cross-validation ($\gamma = 2.25$, $k = 265$, $d = 5$), the predicted pressures track the visually determined values across liquid–liquid, bubble-point, and dew-point transitions, with $R^2 = 0.96$ and MAPE $= 4.51\%$ overall, while the same framework using standard permutation entropy falls to $R^2 = 0.67$ and MAPE $= 15.0\%$. The paper also states the boundary of the claim: transitions from liquid–liquid to vapor–liquid–liquid equilibrium are not captured, with negative $R^2$, because the entropy drift there is gradual and fewer spectra precede the event.
Load-bearing premise
The load-bearing premise is that the expert's visual determination of the transition pressure is accurate enough to serve as ground truth; the paper quotes no uncertainty for those labels and offers no independent thermodynamic check, so the reported $R^2$ and MAPE measure agreement with a human reading of the same spectra rather than with a certified physical transition pressure.
Editorial extensions
If this is right
- Transition pressures in opaque hydrocarbon–CO$_2$ systems can be recovered automatically from NIR spectra alone, removing the need for visual inspection of spectra during depressurization experiments.
- Because the measure uses only relative amplitudes of neighboring measurements, the approach transfers to other spectrophotometrically monitored high-pressure systems with minimal preprocessing.
- The gap between the k-nn entropy ($R^2 = 0.96$) and standard permutation entropy ($R^2 = 0.67$) indicates that exploiting local neighborhood structure and wavelength gaps is what carries the detection, not ordinal symbolization by itself.
- The detector is most accurate when entropy changes are abrupt, so finer pressure sampling should sharpen the transition-pressure estimates.
- The failure on liquid–liquid to vapor–liquid–liquid transitions delimits the method's scope: it detects sharp onsets of two-phase behavior, not gradual multiphase reorganization.
Reading between the lines
- The reported accuracy is measured against expert visual readings of the same spectra, so $R^2 = 0.96$ is best understood as 'the algorithm reproduces an expert's reading automatically,' not as agreement with an independently certified thermodynamic transition pressure; a benchmark against equation-of-state values could move the numbers in either direction.
- Because the expanding window uses only data collected so far, the scheme could be embedded in control software that halts depressurization the moment the band is crossed, enabling automated phase-boundary mapping over many compositions and temperatures.
- Only $k$, $d$, and $\gamma$ were tuned while the random-walk parameters kept their defaults ($n = 10$, $w = 10$, $\alpha = 10$, $\beta = 0.001$); tuning the walk itself is an untested axis that might improve the gradual-transition cases the paper could not resolve.
- A sharp test of generality would be applying the fixed-parameter pipeline to a well-characterized binary mixture with an independently known phase envelope; if the optimal parameters do not transfer, the claim is dataset-specific rather than generic.
Editorial analysis
A structured set of objections, weighed in public.
Referee Report
Summary. The paper proposes a phase-transition detection method for high-pressure CO2/hydrocarbon mixtures based on k-nearest-neighbor permutation entropy computed directly from in situ near-infrared absorbance spectra, combined with an expanding-window anomaly detector. The method is tested on 42 depressurization trials spanning 19 (CO2 concentration, temperature) conditions. For the 41 trials in which a transition out of an initially homogeneous phase was detected, the authors report out-of-sample agreement with visually determined transition pressures of R2=0.96 and MAPE=4.51%, obtained via leave-one-out cross-validation over a grid of the threshold parameter gamma and the entropy parameters k and d. The method is compared with standard permutation entropy, which performs markedly worse, and the paper honestly reports that transitions between liquid-liquid and vapor-liquid-liquid equilibria are not captured reliably.
Significance. If the generalization claim survives a stricter validation scheme, the method would be a useful, low-preprocessing, online complement to visual inspection in opaque high-pressure systems, and the public code and data availability are commendable. The baseline comparison with standard permutation entropy and the explicit reporting of the VLLE failure are strengths. However, the headline 'out-of-sample online predictions' is currently supported only by trial-level cross-validation on heavily replicated conditions, and the reference transition pressures are expert visual labels without quoted uncertainty. The significance of the quantitative result is therefore lower than the abstract implies until the validation granularity is addressed.
major comments (3)
- [Results, Figure 4, and Table S4] The leave-one-out cross-validation is performed over 42 individual trials, but these trials collapse to only 19 distinct (CO2 concentration, temperature) conditions, and multiple runs within a condition share the same visually determined transition pressure (e.g., 35% CO2 at 293 K has four runs with P_exp_t = 6.85 MPa; 45% CO2 at 293 K has three runs with P_exp_t = 8.75 MPa). In each trial-level LOOCV fold, the held-out trial's sibling runs at the same condition remain in the training set, so the grid search over gamma, k, and d can be informed by the very condition whose transition pressure is being predicted. Consequently, the reported R2=0.96 and MAPE=4.51% may reflect within-condition reproducibility rather than generalization to unseen mixture conditions. Please report a leave-one-condition-out evaluation, in which all runs from the held-out condition are excluded from training and all of that condition's runs are used for testing, together with per-condition error metrics, or explicitly qualify the out-of-sample claim as applying only to replicate runs of previously observed conditions.
- [Data and Results] The reference values P_exp_t are described as 'visually determined by an expert' from the same spectral dataset, with no quoted uncertainty and no independent thermodynamic or second-method check. The reported R2 and MAPE therefore quantify agreement with expert visual readings of these spectra, not with certified physical transition pressures. The manuscript itself acknowledges that visually determined pressures are susceptible to experimental errors. Please provide an uncertainty estimate for the visual labels, a sensitivity analysis in which the labels are perturbed within a plausible range, or an independent validation on at least a subset of conditions; otherwise the use of the term 'true pressure' in Figure 4 and Table S4 overstates the reference standard.
- [Methods, Eqs. (5)-(6)] Equation (6) as written defines sigma_P with mu_{P'} inside the summand, where mu_{P'} is the running mean up to each individual pressure P', whereas the threshold band should use the current expanding-window mean mu_P defined in Eq. (5). With the literal formula, sigma_P is not the standard deviation of the H values in the window around mu_P. Please correct the equation if this is a typographical error, and confirm that the implementation uses the corrected definition; because the thresholds H_P^+ and H_P^- depend directly on sigma_P, this point must be unambiguous.
minor comments (5)
- [Methods, after Eq. (4)] The sentence claiming 'H≈1 when a single permutation dominates, whereas H≈0 indicates a uniform distribution' is reversed: for the normalized Shannon entropy in Eq. (4), H=0 corresponds to a single permutation and H=1 corresponds to a uniform distribution over permutation types.
- [Figure 3 caption] The caption says 'Figure 3B shows ... while Figure 3B depicts ...'; the second reference should presumably be to Figure 3C, since the text describes two different trials.
- [Table S4 and Data section] Trial 35 in Table S4 lists a predicted pressure of '1.0.0', which appears to be a typo for '10.0'. In addition, several reference pressures are quoted to two decimal places (e.g., 6.85 MPa) although the text states that spectra were recorded at 0.1 MPa increments; please clarify how the reference pressures were interpolated or rounded.
- [Table S1] The variable descriptions appear to be swapped: lambda should be described as wavelength in nanometers and x_lambda as absorbance in arbitrary units, not the reverse.
- [Data availability] The GitLab repository link is provided, but there is no version identifier, commit hash, or license information; adding these would improve reproducibility.
Circularity Check
No significant circularity: the out-of-sample transition-pressure predictions are generated by a fixed anomaly rule on each held-out trial's own entropy series, with hyperparameters selected by leave-one-out cross-validation, so the headline result does not reduce to a fitted input or to a self-citation chain.
full rationale
The derivation chain is self-contained. The predicted transition pressure is defined algorithmically: Pknn_t is the pressure at which HP first falls outside H±P = µP ± γσP, with µP and σP computed from expanding windows of the trial's own entropy values (Eqs. 5-6). This definition never uses the visual label Pexp_t; the labels enter only in the final R2/MAPE evaluation. Hyperparameters γ, k, and d are selected by leave-one-out cross-validation ('each depressurization trial is iteratively used as a validation set, while the remaining trials constitute the training set'), so the held-out trial's label is not used to set thresholds for that trial. The paper also includes a non-circular control: replacing k-nn entropy with standard permutation entropy under the same protocol degrades R2 to 0.67, showing the result is not an artifact of the anomaly detector alone. The k-nn entropy definition and default walk parameters come from the authors' earlier work (refs 31, 34), but these are public, code-available method papers rather than unverified uniqueness theorems, and no parameter is fitted to the held-out trial's target label. The repeated-condition structure of the dataset (multiple runs per CO2 concentration/temperature sharing one visual label) is a real generalization/leakage concern for the strength of the 'out-of-sample' claim, and the visual labels carry no quoted uncertainty, but these are validation-quality issues, not circularity: the per-trial predictions are still constructed from each trial's own spectra without using its label.
Assumptions & free parameters
free parameters (7)
- k (number of nearest neighbors) =
265 (selected by LOOCV from {10,15,...,300})
- d (embedding dimension) =
5 (selected by LOOCV from {3,4,5})
- gamma (threshold band width) =
2.25 (selected by LOOCV from {1.00,...,3.50})
- n (number of random walks per node) =
10 (default from Ref 31)
- w (random walk length) =
10 (default from Ref 31)
- alpha (return-bias parameter) =
10 (default from Ref 31)
- beta (exploration-bias parameter) =
0.001 (default from Ref 31)
assumptions (5)
- domain assumption The expert visual determination of transition pressures Pexp_t is an accurate ground-truth reference.
- domain assumption A phase transition from a homogeneous mixture to a two-phase state produces an abrupt change in the k-nn permutation entropy of the NIR spectrum that exceeds the expanding-window band mu_P +/- gamma*sigma_P.
- domain assumption Min-max normalization of wavelength and absorbance to [0,1] makes Euclidean distances in the (lambda, x) space a meaningful proxy for spectral neighborhood structure.
- domain assumption The k-nearest neighbor permutation entropy defined in Voltarelli et al. 2024 is a valid complexity measure for unevenly sampled spectra, with defaults n=10, w=10, alpha=10, beta=0.001.
- domain assumption The leave-one-out cross-validation structure, where replicate runs of the same CO2 concentration and temperature appear in the training set, is an adequate test of out-of-sample generalizability.
Cite this review
Pith. "Pith review of Nearest neighbor permutation entropy detects phase transitions in complex high-pressure systems." pith.science (2026). https://pith.science/paper/QC54RYLV
@misc{pith2026250606516,
author = {Pith},
title = {Pith review of: Nearest neighbor permutation entropy detects phase transitions in complex high-pressure systems},
year = {2026},
howpublished = {\url{https://pith.science/paper/QC54RYLV}},
note = {Machine review of arXiv:2506.06516}
}
read the original abstract
Understanding the high-pressure phase behavior of carbon dioxide-hydrocarbon mixtures is of considerable interest owing to their wide range of applications. Under certain conditions, these systems are not amenable to direct visual monitoring, and experimentalists often rely on spectrophotometric data to infer phase behavior. Consequently, developing computationally efficient and robust methods to leverage such data is crucial. Here, we combine nearest neighbor permutation entropy, computed directly from in situ near-infrared absorbance spectra acquired during depressurization trials of mixtures of carbon dioxide and a distilled petroleum fraction, with an anomaly detection approach to identify phase transitions. We show that changes in nearest neighbor entropy effectively signal transitions from initially homogeneous mixtures to two-phase equilibria, thereby enabling accurate out-of-sample online predictions of transition pressures. Our approach requires minimum data preprocessing, no specialized detection techniques or visual inspection of the spectra, and is sufficiently general to be adapted for studying phase behavior in other high-pressure systems monitored via spectrophotometry.
Figures
Figures from the paper (2 more)
Reference graph
Works this paper leans on
-
[1]
Almobarak, M.et al.A review of chemical-assisted minimum miscibility pressure reduction in CO2 injection for enhanced oil recovery.Petroleum7, 245–253, DOI: 10.1016/j.petlm.2021.01.001 (2021)
-
[2]
CO2 Util.33, 303–310, DOI: 10.1016/j.jcou.2019.06.011 (2019)
Li, B.et al.Molecular dynamics simulation of CO2 dissolution in heavy oil resin-asphaltene.J. CO2 Util.33, 303–310, DOI: 10.1016/j.jcou.2019.06.011 (2019)
-
[3]
Rodrigues, H. W., Mackay, E. J. & Arnold, D. P. Multi-objective optimization of CO2 recycling operations for CCUS in pre-salt carbonate reservoirs.Int. J. Greenh. Gas Control.119, 103719, DOI: 10.1016/j.ijggc.2022.103719 (2022)
arXiv 2022
- [4]
-
[5]
Romero Yanes, J. F.et al.Study of liquid–liquid and liquid–liquid–vapor equilibria for crude oil mixtures with carbon dioxide and methane using short-wave infrared imaging: Experimental and thermodynamic modeling.Energy & Fuels34, 14109–14123, DOI: 10.1021/acs.energyfuels.0c03064 (2020)
-
[6]
R.et al.Near infrared spectroscopy applied for high-pressure phase behavior measurements
Borges, G. R.et al.Near infrared spectroscopy applied for high-pressure phase behavior measurements. The J. Supercrit. Fluids104, 221–226, DOI: 10.1016/j.supflu.2015.06.015 (2015)
-
[7]
A.et al.CO2 influence on asphaltene precipitation.The J
Cruz, A. A.et al.CO2 influence on asphaltene precipitation.The J. Supercrit. Fluids143, 24–31, DOI: 10.1016/j.supflu.2018.08.005 (2019)
-
[8]
Alher, A. A., Aljawad, M. S. & Alyasery, A. A. Estimating the PVT properties for crude oil from a Southern Iraqi oil field.IOP Conf. Series: Mater. Sci. Eng.433, 012076, DOI: 10.1088/1757-899X/ 433/1/012076 (2018)
Show all 36 references
-
[9]
Regueira, T., Glykioti, M.-L., Kottaki, N., Stenby, E. H. & Yan, W. Density, compressibility and phase equilibrium of high pressure-high temperature reservoir fluids up to 473 K and 140 MPa.The J. Supercrit. Fluids159, 104781, DOI: 10.1016/j.supflu.2020.104781 (2020). 12/15
2020
-
[10]
A.et al.Use of real crude oil fractions to describe the high pressure phase behavior of crude oil in carbon dioxide.The J
Lucas, M. A.et al.Use of real crude oil fractions to describe the high pressure phase behavior of crude oil in carbon dioxide.The J. Supercrit. Fluids118, 140–147, DOI: 10.1016/j.supflu.2016.08.004 (2016)
2016 doi
-
[11]
& Fleming, F
Daridon, J.-L., Lin, C.-W., Carrier, H., Pauly, J. & Fleming, F. P. Combined investigations of fluid phase equilibria and fluid–solid phase equilibria in complex CO2–crude oil systems under high pressure.J. Chem. & Eng. Data65, 3357–3372, DOI: 10.1021/acs.jced.0c00144 (2020)
2020 doi
-
[12]
Romero Yanes, J. F.et al.Phase behavior investigation of a live presalt crude oil from short-wave infrared observation, acoustic wave sensing, and equation of state modeling.Energy & Fuels35, 18504–18517, DOI: 10.1021/acs.energyfuels.1c02980 (2021)
2021 doi
-
[13]
Dohrn, R., Fonseca, J. M. & Peper, S. Experimental methods for phase equilibria at high pressures. Annu. Rev. Chem. Biomol. Eng.3, 343–367, DOI: 10.1146/annurev-chembioeng-062011-081008 (2012)
2012 doi
-
[14]
7 ofSupercritical Fluid Science and Technology(Elsevier, 2015)
Braeuer, A.In situ Spectroscopic Techniques at High Pressure, vol. 7 ofSupercritical Fluid Science and Technology(Elsevier, 2015)
2015
-
[15]
& Fonseca, J
Dohrn, R., Peper, S., Secuianu, C. & Fonseca, J. M. High-pressure fluid-phase equilibria: Experimental methods, developments and systems investigated (2013–2016).Fluid Phase Equilibria579, 113978, DOI: 10.1016/j.fluid.2023.113978 (2024)
2024
-
[16]
& Pompe, B
Bandt, C. & Pompe, B. Permutation entropy: A natural complexity measure for time series.Phys. Rev. Lett.88, 174102, DOI: 10.1103/PhysRevLett.88.174102 (2002)
2002 doi
-
[17]
Zanin, M., Zunino, L., Rosso, O. A. & Papo, D. Permutation entropy and its main biomedical and econophysics applications: A review.Entropy14, 1553–1577, DOI: 10.3390/e14081553 (2012)
2012 doi
-
[18]
& Wessel, N
Riedl, M., Müller, A. & Wessel, N. Practical considerations of permutation entropy.The Eur. Phys. J. Special Top.222, 249–262, DOI: 10.1140/epjst/e2013-01862-7 (2013)
2013 doi
-
[19]
M., Keller, K
Amigó, J. M., Keller, K. & Unakafova, V . A. Ordinal symbolic analysis and its application to biomedical recordings.Philos. Transactions Royal Soc. A373, 20140091, DOI: 10.1098/rsta.2014. 0091 (2015)
2015 doi
-
[20]
& Werner, J
Keller, K., Mangold, T., Stolz, I. & Werner, J. Permutation entropy: New ideas and challenges. Entropy19, 134, DOI: 10.3390/e19030134 (2017)
2017 doi
-
[21]
Pessa, A. A. B. & Ribeiro, H. V . ordpy: A Python package for data analysis with permutation entropy and ordinal network methods.Chaos: An Interdiscip. J. Nonlinear Sci.31, 063110, DOI: 10.1063/5.0049901 (2021)
2021 doi
-
[22]
Li, X. & Li, C. Application of permutation entropy in feature extraction for near-infrared spectroscopy noninvasive blood glucose detection.J. Spectrosc.2017, 9165247, DOI: 10.1155/2017/9165247 (2017)
2017 doi
-
[23]
Li, X. & Li, C. Pretreatment and wavelength selection method for near-infrared spectra signal based on improved ceemdan energy entropy and permutation entropy.Entropy19, 380, DOI: 10.3390/e19070380 (2017)
2017 doi
-
[24]
Garland, J.et al.Anomaly detection in paleoclimate records using permutation entropy.Entropy20, 931, DOI: 10.3390/e20120931 (2018). 13/15
2018 doi
-
[25]
& Jin, N
Ren, W., Zhang, J. & Jin, N. Rescaled range permutation entropy: a method for quantifying the dynamical complexity of gas-liquid two-phase slug flow.Nonlinear Dyn.104, 4035–4043, DOI: 10.1007/s11071-021-06468-2 (2021)
2021 doi
-
[26]
& Ren, W
Zhang, J., Jin, N. & Ren, W. Detecting the fluid flow transitions in oil–gas–water three-phase flows using multivariate rescaled range permutation entropy analysis.The Eur. Phys. J. Plus137, 808, DOI: 10.1140/epjp/s13360-022-03026-6 (2022)
2022 doi
-
[27]
& Kurths, J
Du, M., Wei, J., Li, M.-Y ., Gao, Z.-k. & Kurths, J. Interconnected ordinal pattern complex network for characterizing the spatial coupling behavior of gas–liquid two-phase flow.Chaos: An Interdiscip. J. Nonlinear Sci.33, 063108, DOI: 10.1063/5.0146259 (2023)
2023 doi
-
[28]
& Grebogi, C
Du, M., Zhang, L., Niu, X. & Grebogi, C. Detecting gas-liquid two-phase flow pattern determinism from experimental signals with missing ordinal patterns.Chaos: An Interdiscip. J. Nonlinear Sci.30, 093102, DOI: 10.1063/5.0016401 (2020)
2020 doi
-
[29]
Sigaki, H. Y . D., de Souza, R. F., de Souza, R. T., Zola, R. S. & Ribeiro, H. V . Estimating physical properties from liquid crystal textures via machine learning and complexity-entropy methods.Phys. Rev. E99, 013311, DOI: 10.1103/PhysRevE.99.013311 (2019)
2019 doi
-
[30]
A., Zola, R
Pessa, A. A., Zola, R. S., Perc, M. & Ribeiro, H. V . Determining liquid crystal properties with ordinal networks and machine learning.Chaos, Solitons & Fractals154, 111607, DOI: 10.1016/j.chaos.2021. 111607 (2022)
2022 doi
-
[31]
V oltarelli, L. G. J. M.et al.Characterizing unstructured data with the nearest neighbor permutation entropy.Chaos: An Interdiscip. J. Nonlinear Sci.34, 053130, DOI: 10.1063/5.0209206 (2024)
2024 doi
-
[32]
& Leskovec, J
Grover, A. & Leskovec, J. node2vec: Scalable feature learning for networks. InProceedings of the 22nd ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, KDD ’16, 855–864, DOI: 10.1145/2939672.2939754 (Association for Computing Machinery, New York, NY ,...
-
[33]
B., Protopopescu, V
Cao, Y ., wen Tung, W., Gao, J. B., Protopopescu, V . A. & Hively, L. M. Detecting dynamical changes in time series using the permutation entropy.Phys. Rev. E70, 046217, DOI: 10.1103/PhysRevE.70. 046217 (2004)
2004 doi
-
[34]
V oltarelli, L. G. J. M.et al.knnpe: A Python package implementing the k-nearest neighbor permutation entropy. Available: https://github.com/hvribeiro/knnpe (2024). Accessed: 16 Feb 2025
2024
-
[35]
Pessa, A. A. B. & Ribeiro, H. V . A Python package for data analysis with permutation entropy and ordinal network methods (ordpy). Available: https://github.com/arthurpessa/ordpy (2021). Accessed: 16 Feb 2025
2021
-
[36]
& Taylor, J.An Introduction to Statistical Learning: with Applications in Python
James, G., Witten, D., Hastie, T., Tibshirani, R. & Taylor, J.An Introduction to Statistical Learning: with Applications in Python. Springer Texts in Statistics (Springer International Publishing, 2023). Acknowledgements The authors acknowledge the support of the Coordenação d...
2023
Reviewed August 7, 2026 · model on record in the stance chip above.
Discussion (0). Sign in to comment.