dataesr/scientific-paragraphs-categorization huggingface dataset:
Detecting new lesions is a key aspect of the radiological follow-up of patients with Multiple Sclerosis (MS), leading to eventual changes in their therapeutics. This paper presents our contribution to the MSSEG-MICCAI challenge. The challenge is focused on the segmentation of new MS lesions using two consecutive Fluid Attenuated Inversion Recovery (FLAIR) Magnetic Resonance Imaging (MRI). In other words, considering longitudinal data composed of two time points as input, the aim is to segment the lesional areas, which are present only in the follow-up scan and not in the baseline. The backbone of our segmentation method is a D UNet applied patch-wise to the images, and in which, to take into account both time points, we simply concatenate the baseline and follow-up images along the channel axis before passing them to the D UNet.
The backbone of our approach is a patch-wise 3D  UNet (Çiçek et al. , 2022). Our key methodological contribution is to introduce online hard example mining  (Shrivastava et al. , 2016)  (OHEM) to tackle class imbalance. Indeed, one important characteristic of the dataset is that there are fewer voxels belonging to a new lesion (positive) than not belonging to a new lesion (negative), images comprise on average approximately 0. 005% of positive voxels. Notably, we use a moving average of our 3D UNet to perform inference for hard example mining. Our goal is that, similar to  He et al. (2020) , doing so will provide more stable predictions as training progresses. The present paper extends that published in the proceedings of the MICCAI MSSEG-2 2021 workshop  (Commowick et al. , 2021)  by providing a more extensive description of the methodology as well as more detailed experimental results including the testing of the algorithm on another cohort  (Bodini et al.
Methods Preprocessing We resampled each FLAIR image to a voxel size of 0. 5 mm as it is the highest resolution of the training dataset and applied a z-score normalization to each FLAIR individually. As the two consecutive FLAIR images (baseline and follow-up) of a patient have been aligned in the halfway space using a rigid transformation by the challenge providers, our method starts by concatenating them along the channel dimension, resulting in a tensor of shape 2 * D * H * W, where D, H, and W are, respectively, the depth, height, and width of the resampled FLAIR image. This tensor is then subdivided into patches of shape 2 * 32 * 32 * 32, which are passed through a 3D UNet to obtain the segmentation.
Dataset We used the MICCAI MSSEG-2 datasets  (Commowick et al. , 2021)  for training, validation, and the first testing set (see Appendix). We also used a second testing set consisting of a previously published MS cohort from our laboratory  (Bodini et al. , 2016). This cohort was constituted of 19 patients with active relapsing remitting MS (13 women, mean age 32. 3 years sd 5. 6) who underwent two MRIs with FLAIR spaced from minimum 31 days to maximum 120 days. Of those 19 patients, only 18 had available FLAIR MRIs for each visit. As only one of those 18 remaining patients had no new lesions at the second visit, we focused on the 17 patients that presented new lesions at the second visit for the second testing dataset. For these 17 patients, the new lesions at the second visit were manually contoured in native space and verified by a senior neurologist.
Training-OHEM vs. oversampling comparison We optimized each network for 3 h on one NVIDIA Tesla P100 graphic card using Adam  (Kingma and Ba, 2022). Note that for OHEM, the duration of one iteration is roughly 2 times longer. In the end, 3 h of training corresponds to about 30k iterations with OHEM and 64k without. The initial learning rate was set to 10 -3 and decayed to 10 -4 and 10 -5 after, respectively, 50 and 80% of the training time. We split the dataset into 30 patients for training, and 10 for validation. We compared the learning curves using the Dice score on the validation set for six training procedures: three with OHEM with a momentum of, respectively, 0, 0. 9, and 0. 99, and three without OHEM but with oversampling with a probability p of, respectively, 0 (uniform), 0. 1, and 0.
Training-Final approach provided for the MSSEG-challenge We used the model described before, using OHEM with a momentum of 0. 9, and trained the model on the whole MICCAI MSSEG-2 training dataset for 30k iteration. As above, the initial learning rate is set to 10 -3 and decayed to 10 -4 and 10 -5 after, respectively, 50 and 80% of the training time.
Evaluation metrics for the testing dataset The evaluation procedure was defined by the MICCAI MSSEG-2 committee  (Commowick et al. , 2021). We briefly recall this procedure in the following. The MICCAI MSSEG-2 testing dataset of 60 patients was divided into two subsets, according to the presence or absence of new lesions in patients: 28 patients without new lesions and 32 patients with new lesions. Those two datasets were evaluated differently. All new lesions from the ground truth and our algorithm prediction were individualized by computing the connected components, and all lesions smaller than 3 mm 3 were removed  (Commowick et al. , 2018). The detection was defined at the lesion level using the algorithm described by  Commowick et al. (2018)  with the parameters α = 10%, β = 65%, and γ = 70%, which were set by the MICCAI MSSEG-2 committee.
• PPV = TP pred n new lesions pred where TP pred and n new lesions_pred are, respectively, the true positives with respect to our prediction and the number of new lesions in our prediction. • F 1 = 2 * Sens * PPV Sens+PPV where Sens and PPV are, respectively, the previously defined sensitivity and Positive Predictive Value. All of those metrics were compared to zero for patients without new lesion, and to the ground truth segmentation of patients with new lesion, which is the consensual segmentation from four expert annotators  (Commowick et al. , 2021). All results are presented as mean, Standard Error to the Mean (SEM), and rank among other challenge pipelines when available. For the second testing dataset, constituted by the 17 patients with new lesions in our cohort, we used exactly the same evaluation procedure that we described above for the patients with new lesions from the MICCAI MSSEG-2 testing dataset.
Together with the relatively high sensitivity but relatively low PPV, this could be explained by a bias in the OHEM training toward a high detection rate, resulting in a greater false positive rate. This trend was even stronger when we evaluated the algorithm performances on our second testing dataset, with a higher Dice score of 0. 465, a higher sensitivity of 0. 901 but a lower PPV of 0. 239. When compared to other pipelines of the challenge, the best pipeline in the subset of patients without new lesions, consisting of a 3D UNet with pre-activation block, also used an oversampling strategy for Regions of Interest with new lesions, but was also ranked in the mid-class of the challenge for the Dice score on the patients with new lesions (with a Dice score of 0. 409). The most accurate pipeline in terms of Dice score (even better than several annotators), which did not use any oversampling strategy, was ranked in the midclass of the challenge for the subset of patients without new lesions for the score of new lesions detection rate.
However, there is still a long way to go for clinical applications of algorithms for new lesion segmentation. This will require not only algorithm improvement but also prospective validation studies on larger and very diverse datasets. There was only one pipeline in the challenge that did not use deep learning. Even if they outperformed four deep learning teams on average, their ranking was low on the MICCAI MSSEG-2 testing dataset, with a mean Dice of 0. 309 for patients with new lesions, and a mean volume of new lesions detected of 177. 9 mm 3 for patients without new lesions. This does not mean that non-deep-learning methods are not potentially useful for this task but this would require additional comparisons which are outside of the scope of the present work. To our knowledge, most of the previously published deep learning algorithms  (McKinley et al.
Even worse, it can vary across epochs due to the nature of the OHEM method. Another limitation is that we used a single split into training and validation rather than a cross-validation strategy. Thus, we did not use all samples for testing and we did not assess their variability when varying the training set. We made this choice because we had to provide one single result for the challenge. We did not use data augmentation in our training strategy to be able to compare different oversampling strategies and momentum, but OHEM comportment should be explored with data augmentation in future work. Due to the short delay between baseline and followup MRIs in the MICCAI MSSEG-2 dataset (from 1 to 3 years) as well as in our second testing dataset (maximum 120 days), we could not explore the influence of severe atrophy in this task.
An adjacent and clinically useful task for longitudinal follow-up of MS patients, that we could not assess here due to challenge constraints focusing on new lesions, is the detection of shrinking and enlarging lesions. Furthermore, it is likely that the use of multicontrast MRI could improve the results over the use of FLAIR alone. The aim of the MICCAI 2021 MSSEG-2 challenge was to develop an algorithm only based on two longitudinal FLAIRs. Thus, our present work only uses FLAIR as input and a comparison with a multicontrast input is left for future work. Another important aspect that remains to be studied is generalizability to other acquisition settings. In the MICCAI MSSEG-2 challenge, there was quite a variety of different MRI machines. Furthermore, it is interesting to note that the General Electric machines present in the MICCAI MSSEG-2 dataset were not present in the training dataset.
Funding The research leading to these results has received funding from the  French government  under management of  Agence Nationale de la Recherche  as part of the  Investissements d'avenir program , reference  ANR-19-P3IA-0001  ( PRAIRIE 3IA Institute) , reference  ANR-10-IAIHU-06  ( Agence Nationale de la Recherche - 10-IA Institut Hospitalo-Universitaire-6 ), and reference number  ANR-19-P3IA-0002  ( 3IA Côte d'Azur ) and from  ICM  under the  Big Brain Theory program  (project  IMAGIN-DEAL in MS-M ). This work was supported by the  Fondation pour la Recherche Médicale , Grant No. FDM202006011247  to.
MICCAI MSSEG-2 testing dataset: patients with new lesions (n = 32) Lesion-level F 1 score per patient, mean (SEM); rank Dice score per patient, mean (SEM); rank Sens at lesion level per patient, mean (SEM) PPV at lesion level per patient, mean (SEM) TABLE Results on the testing set using MICCAI MSSEG-evaluation metrics, with the specific evaluation metrics from MICCAI MSSEG-testing dataset for the patients with new lesions (a) as well as for the patients without new lesions (b), and the patients with new lesions from our second testing dataset (c). (a) 0. 446 (0. 057); 13 th /29 0. 400 (0. 051); 18 th /29 0. 616 (0. 069) 0. 383 (0. 054) (b) MICCAI MSSEG-2 testing dataset: patients without new lesion (n = 28) Number of new lesions predicted per patient, Lesion volume predicted in mm 3 per patient, mean (SEM); rank mean (SEM); rank 0.
Second testing dataset: patients with new lesions (n = 17) Lesion-level F 1 score per patient, mean (SEM) Dice score per patient, mean (SEM) Sens at lesion level per patient, mean (SEM) PPV at lesion level per patient, mean (SEM) 0. 365 (0. 038) 0. 465 (0. 046) 0. 901 (0. 043) 0. 239 (0. 030).
We present PhaseX, a simulation code for X-ray phase-contrast imaging (XPCI), specially dedicated to the study of matter under extreme conditions (of pressure and density). Indeed, XPCI can greatly benefit the diagnosis of such states of matter. This is due to the noticeable contrast enhancement obtained thanks to the exploitation of both attenuation and phase-shift of the electromagnetic waves crossing the sample to be diagnosed. PhaseX generates synthetic images with and without phase contrast. Thanks to its modular design PhaseX can adapt to any imaging set-up and accept as inputs objects generated by hydrodynamic or particle-in-cell codes. We illustrate Phase-X capabilities by showing a few examples concerning laser-driven implosions and laser-driven shock waves.
Other Items to Check • Please note that the original manuscript has been converted to XML prior to the creation of the PDF proof, as described above. The PDF proof was generated using LaTeX for typesetting. The placement of your figures and tables may not be identical to your original paper. • Please carefully check all key elements of the paper, particularly the equations and tabular data. • Author list: Please make sure all authors are presented, in the appropriate order, and that all names are spelled correctly. • If you need to supply new or replacement figures, please upload each figure as an individual PDF file at the desired final figure size. The figure must fit inside the margins of the manuscript, i. e. , width no more than 5. 3 inches (or 13. 46 cm). Confirm the quality of the figures and upload the revised files when submitting proof corrections.
Introduction In this paper, we present PhaseX, a code for X-ray phase contrast imaging, specifically designed for the generation of synthetic images of samples of matter under extreme conditions (of pressure and density). X-ray phase-contrast imaging (XPCI) is a powerful diagnostic tool that takes advantage of the phase-shift of the electromagnetic wave  [1]  as it crosses a sample to be imaged. When an object is irradiated with X-rays, the dominant interactions are attenuation, and for the transmitted part, phase-shift. In X-ray attenuation contrast imaging (XACI) the image results from the difference in attenuation among various parts of the sample. Instead XPCI also includes the contribution of the phase shift undergone by radiation as it crosses different parts of the sample. In other words, XACI is related to the imaginary part (β) of the refraction index of matter n = 1 -δ + iβ, while in XPCI the real part (1 -δ) of such an index also plays a role.
In this context, it is therefore crucial to develop a simulation code that can support researchers in the preparation of the experiments and related data analysis. The literature presents several XPCI simulation codes. Some of them are specifically suited for medical purposes  [24, 25] , other codes are general purpose  [26] [27] [28] [29]. References  [26] [27] [28] [29]  employ a Monte Carlo method to describe photon interactions, and then use a wave-optics approach to generate the image. However, all these codes work for matter under standard conditions and are not designed to be coupled with hydrodynamic or particle-in-cell (PIC) codes. Kar et al. [9]  present an imaging simulation code for plasma experiments entirely based on a geometrical optics approach. By contrast, PhaseX adopts a wave-optics approach.
The results of this choice are a better definition of small features and a reduced computational power and time. PhaseX can support researchers in all the contexts described above, by linking PIC and hydrodynamics codes (whose output quantities are not directly measurable) to the diagnosed quantities. The code currently handles the propagation based imaging (PBI) scheme  [1]  and the relative options for spherical and planar wave. We are planning to add extra modules to handle Talbot-Lau and Analyzer-based imaging schemes  [1]. Thanks to the modular design, we can easily update PhaseX and improve its capability and performance responding to the requirements coming from different users. Access to the code is available on request to the authors. This paper is organized as follow: Sec. 2 describes the model implemented in the code; Sec.
Modelling PhaseX produces a synthetic image which results from the application of the following expression: I R = I I * PSF, ( 1 ) where the real image I R is the result of the convolution between the ideal image I I (which includes both the contribution of attenuation and phase-shift) and the point spread function of the imaging system (PSF). The latter is the convolution between the source spatial distribution σ S and the detector point spread function PSF D. Fig. 1  shows the flow chart of the code with its various packages. The code is based on a modular design, where each package executes a set of instructions necessary to calculate one of the components of Eq. (1). Moreover, the same quantities can be calculated following different approximations and procedures which depend on the given experimental set-up.
Modules Figure  4  shows the modules implemented in each package of PhaseX. The gray box gathers packages whose modules have different versions allowing to take into account the source spectrum and the object composition. Sec. 2 refers to a monochromatic source. However, for a broadband spectrum source Eq. (  1 ) becomes  [43] : I R,poly = ∑︂ λ (w λ I I,λ ) * PSF ( 13 ) where I I,λ is the ideal image computed for each wavelength channel, and w λ is the weight of the channel that takes into account the source emission intensity and the imaging system spectral response. In practice, Eq. (  13 ) means that the code repeats the procedure described by the flowchart in Fig. 1  for each wavelength channel. At the end it sums all the images and it convolves the result with the system PSF. The main application of PhaseX is the the study of HED physics, so the object description is typically obtained from density maps obtained from hydrodynamic simulations.
The density map has one, two, or three dimensions depending on the object symmetry, and this explains the 2D and 3D modules in the transmission function package (Fig. 4 ). We did not implement a 1D module because we treat it as a special case of the cylindrical symmetry case (2D). In addition, hydrodynamic codes can either be Lagrangian or Eulerian. In the first case, PhaseX employs a routine to remap the code mesh on an equally spaced orthogonal mesh. In both cases, the hydrodynamic quantities needed on each PhaseX mesh point are density, electron temperature and material composition. The "Refractive index" package implements three modules: "Solid" calculates the refractive index via Eq. (  7 ), "Free electron" calculates the refractive index via Eq. (  9 ) and the module "Warm" that calculates the refractive index for material at a temperature higher than the standard one.
Implementation The modular architecture of PhaseX ensures an easy and fast update of the code. In this way, we can adapt the code to different objects and experimental setups. Most of the code is written using Python (version 3) for it is open-source and has a user-friendly architecture. Moreover, Python allows using external libraries written in different languages. We used this capability to write the transmission function modules that calculate the transmission function using a ray-tracing algorithm. The transmission function modules calculate the transmission function (Eqs. (  5 ) and 6). These are the line integral of δ and β along the X-ray path that connects the source to a point contained on an ideal plane located behind the object. To do so, the module uses a ray-tracing algorithm.
To better accomplish this task, we wrote them in FORTRAN, implementing a multi-threading parallel construct with OpenMP. A ray-tracing algorithm requires multiple nested loops and conditional statements, all of them are computationally expensive and FORTRAN can run them much faster than Python. Moreover, Python (via its modules NumPy) can saturate the available memory when it performs vectorized calculation over arrays. The FORTRAN module is wrapped inside the main Python code. All these features allow PhaseX to run on a small system like a laptop. The parameters and instructions necessary for simulation are given as a set of keywords contained in a text file. Supplement 1 shows the input file used for the example presented in Sec 4. 2.
Applications We used an earlier version of PhaseX (not including the treatment of warm matter) in the preparation and analysis of the experiments described in Refs. [41, 42]. The main use of PhaseX concerns dynamic situations. However, simulating the hydrodynamics occurring in laser-matter interaction is extremely difficult. Hydrodynamics has non-linear dependency on multiple parameters, and most of them cannot be measured properly in an experiment. Using these experiments as an initial benchmark for PhaseX could be risky. A discrepancy between simulated and measured images could be induced by an "error" in the hydrodynamic simulation used as input for PhaseX. To limit the source of "errors" only to PhaseX, we performed first tests using static objects. We tested the code on a nylon wire (see Fig.
To generate the opacity tables used by PhaseX, we used the web interface  [48]  to the TOPS code  [32]. In all cases the distance from the X-ray source to the object was 2. 5 cm and the distance object-detector 150 cm. We assumed a monochromatic X-ray source at 8. 04 keV (the copper Kα line) with a Gaussian spatial distribution. Regarding the full width half maximum of the distribution, we assumed 10 µm for the spherical implosion cases, and 5 µm for the shock-wave interaction. As detector, we used an imaging plate with intrinsic resolution of 100 µm. We applied XPCI in dynamic situations. However, image blurring due to plasma motion is negligible in typical cases, even when matter velocities reach values as large as 500 km/s. During the backlighting pulse (with duration shorter than 10 ps), the plasma moves less than 5 µm.
Conclusion In this work, we presented PhaseX, a code for X-ray imaging simulation. The code generates synthetic images with and without phase-contrast. Its modular design allows adapting the code to the imaging setup. This feature is crucial during the experiment design and later to analyze the acquired data. Thanks to the different models implemented, PhaseX can handle simulations of warm materials, which is essential to study matter under extreme conditions. We have shown three applications of PhaseX to cases of interest for ICF and HED. In the three simulations, we modelled the imaging setup on the parameters available at large-scale facilities. For all cases, we have shown that XPCI achieves a higher definition and contrast than XACI, with a consequent increase in spatial resolution. In the first two cases, the solid-cold model overestimates the attenuation for temperature values above the room temperature.
The result is a reduction of the contrast at the interface compared to the contrast obtained with the warm models. PhaseX is a powerful tool that could help researchers to design experiments that employ radiography diagnostics. To accomplish this task we will keep updating the code by implementing in future release modules that handle different detection schemes (Talbot-Lau and diffraction enhanced imaging) and X-ray optics (crystal and refractive optics). As we said at the beginning of this work, the object emits light (also in the X-ray spectrum) that can cover up the diagnostic signal. We are working on a module that calculates the intensity map of the target self-emission. Acknowledgments. L. Antonelli acknowledges funding from EPSRC grant EP/P026796/1.